GVS Player Input
Last updated
Last updated
Never modify iMoves files directly. Make a copy of the Unity's new input system asset and use that instead of iMove's GVS_iMoveInputActions. Store your copy somewhere in your project, not within the GVS folders. Modifying an original iMove file may result in your data being overridden when iMove pushes an update.
The GVS Player Input component is found on your player, and allows you to quickly bind inputs from Unity's New Input System to useful actions within iMove or any other component.
To bind different inputs from Unity's new input system asset, simply drag and drop them into the default inputs UI.
Default inputs can be accessed by code via the input struct.
For example, to get the jump boolean: bool test = GVS_Player_Input.Input.Jump
There are Unity events for each default input. You can either access them via code GVS_Player_Input.OnMovePressed.AddListener(YourMethodHere)
or by clicking the (+) button in the inspector, and assigning a method for when that event is called.
Using the (+) button in the inspector is a great way to quickly add things like sounds to your actions.
By default, sprint and sneak have a toggle threshold of 0.25 seconds. This means that if you tap the sprint key once, it will toggle sprinting on. If you hold the sprint key longer than 0.25 seconds, the sprint will not toggle, but stay on until you release the key. To turn off toggling functionality, simply set the toggle threshold to 0.
Custom input bindings can be used for anything you like. All you need to do is create an input action within Unity's new input system, then assign it to the custom binding. Make sure your custom binding matches the same variable type as your input action.
Here is an example of calling a custom iMove animation using a custom input binding: For more info on adding custom iMove animation actions, see this page.