🏃♂️Locomotion
Last updated
Last updated
The Locomotion State ID is 1. It allows the animal to move while it's on any ground surface
When the character moves it uses the MAnimal.Move(Vector 3 Direction)
method, this will activate the locomotion animations.
To create a new Locomotion State, click the Plus button on the States list and select: [Locomotion]
Or duplicate any of the already created locomotion assets of any animal you own and drag it to the States List.
Locomotion should always be on top of the Idle and below all other assets.
The Idle State does not require extra gameobjects, pivots, or internal animal configuration. Just an animation or animations to be used as Idles.
The Animal has detected any movement. (Movement Detected = true)
The Animal is grounded. (Grounded = true)
You can always Force its activation via code.
Animal.State_Force(1)
or Animal.State_Force(StateEnum.1)
Through code, the exit conditions will be executed to check if the State can exit. In the case of this state, the conditions are:
The Animal has NOT detected any movement. (Movement Detected = false)
The Sub-State Machine [Locomotion] will hold all the Locomotion Animations.
Its entering transition conditions are:
All States have a core animation, on which the animal will play while the state is active. In the case of locomotion, a blend tree is required with all the speeds the character may have,
The core animations must be always tagged just like the Name of the State ID.
The multiplier parameter is linked to the SpeedMultiplier. This handles the speed of the animation with the Speed Modifiers.
The Locomotion will exit only when there is no movement registered.
Layer used in the raycast to check front Walls and stop the character from moving.
Antifall allows the animal to avoid ledges. This is used mainly for huge animals that does not have the Fall State and it should avoid falling from edges at all times. E.g. The elephant
When you set a new Tag and Use it on the Enter Tag Parameter, the Vertical parameter on the animator will be set with no smoothness to the Speed Vertical value. E.g. If we are entering from Idle To locomotion in a Run Speed, the Vertical will be set to 3 directly. This is used to play IdleToRun animations correctly.