Use the character actions
Getting the action struct
The CharacterActions struct can be obtained from the CharacterBrain component.
If you are working from inside a state you can call the CharacterActions property (not the class):
Reading the actions
Just access the public member you want from the CharacterAction struct.
Bool actions
Float and Vector2 actions are most of the time related to analog values. Their value is what's important. On the other hand, with bool actions it is often more important the "phase" of the action.
For a button, the phases are started (similar to the classic "GetButtonDown") and canceled ("GetButtonUp").
Vector2 actions
If you are using the old InputManager (the default input system used by the demo scenes) you can create a Vector2 action from the project settings, even though these type of actions are not supported.
The Vector2 action is just a mix between two float actions.
To define a Vector2 action you need to create two input axis:
The Name of the action + space + "X"
The Name of the action + space + "Y"
For instance, the "movement" action is defined like this:
Last updated