Sleitnick / AeroGameFramework

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
https://sleitnick.github.io/AeroGameFramework/
MIT License
216 stars 57 forks source link

UserInput:Get("Mouse") not working #112

Closed Syslog777 closed 4 years ago

Syslog777 commented 4 years ago

https://gyazo.com/f8887ef6e0c804044c6b782f90d3bacd Mouse is a field in the controller script. https://gyazo.com/ecc9e24cf34098d44a16379fa3108fe2 I use UserInput:Get(module name) but it does not load the module. I see you have used WrapModule. How can I fix this?

Syslog777 commented 4 years ago

Nvm, I was using it from Init, which isnt safe.

Sleitnick commented 4 years ago

Yup, you got it. The UserInput module's Init method loads all the controller modules under it.

However, if you want to use it from your other Inits, then you could set the UserInput's __aeroOrder to something like 1:

local UserInput = {}
UserInput.__aeroOrder = 1 -- Add this line

As long as your module either doesn't have __aeroOrder defined or has it defined as a larger number then it would initialize after the Input module.

But this is only in the new v1.4.1 version.