Input and Locomotion
Here's the basics
InputBroker collects inputs from devices and sanitizes them. Player takes ownership of those inputs. The Player Avatar has classes like Locomotion which read the inputs inside the owning Player and applies movement translation to the Avatar Object.
Default implementation uses the built in CharacterController. You can override this and implement your own character controller or a third party one.
If you press an action which causes the Animator to enter a state that needs Root Motion - such as a Jumping Attack Slam or something - then you can add a StateBehavior which will tell the locomotion system to definitely include the root motion data in the motion while the Animator is in that state.
There's several State Behaviors you can use to do various things. For instance while doing that Jump Attack you don't want the character moving in weird directions or turning, or using abilities, right? Just add AnimStateDenial and specify you want those things disabled while in this Animation State. The script will make sure the Locomotion is informed of the restriction.
Why do it this way?
The benefit is Inputs are decoupled from character Behavior. Everything downstream of InputBroker operates on exact input requirements that are sanitized. Handling different devices is a problem that is purely isolated to InputBroker. No downstream class needs to deal with it.
Work is in progress for this page.
Last updated
Was this helpful?