๐Ÿƒโ€โ™‚๏ธLocomotion

Overview

The Locomotion State ID is 1. It allows the animal to move while it's on any ground surface

How it works

When the character moves it uses the MAnimal.Move(Vector 3 Direction)method, this will activate the locomotion animations.

Creating the State

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.

Priority

Locomotion should always be on top of the Idle and below all other assets.

Requirement

The Idle State does not require extra gameobjects, pivots, or internal animal configuration. Just an animation or animations to be used as Idles.

Activation Condition

This state is Activated automatically when any movement is registered on the Animal Controller.

You can always Force its activation via code.

Animal.State_Force(1) or Animal.State_Force(StateEnum.1)

Exit Conditions

Through code, the exit conditions will be executed to check if the State can exit. In the case of this state, the conditions are:

  • Movement on the Animal NOT being registered. MAnimal.MovementAxis != Vector3.zero

Animator

Locomotion Sub-State Machine

The Sub-State Machine [Locomotion] will hold all the Locomotion Animations.

Its entering transition conditions are:

Core Animations

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.

Exit Condition

The Locomotion will exit only when there is no movement registered.

Last updated