๐Ÿ•ด๏ธIdle

Overview

The Idle State is the most basic state on the controller. Its State ID is 0. It allows the animal to stay idling in a single position.

Idle is the only state that does not require any further configuration. It has no custom parameters.

How it works

This works as the base state, when the animal is idling. Doing nothing

To give more personality to the character you can have more than one Idle animation and randomize playing them using the Random Behaviour on the Animator Controller.

Creating the State

To create a new Idle State Click the Plus button on the States list and add the Idle

Or duplicate any of the already created States asset of any animal you own and drag it to the States List.

Priority

It has the lowest priority of all states and it should always be at the bottom of the list.

All Higher states can be activated.

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 there's no Movement registered on the Animal Controller.

You can always Force its activation via code.

Animal.State_Force(0) or Animal.State_Force(StateEnum.Idle)

Exit Conditions

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

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

Animator

The Idle state requires animation states in charge of the Idle Logic.

Idle Sub-State Machine

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

Its entering transition conditions are:

The Idle Substate machine is the only Subtate machine that needs a transition to itself:

This allows the idles animations inside the state to exit and then come back to the next Idle Animation.

Core Animations

All States have a core animation, on which the animal will play while the state is active. In case of Idle, all idle animations are core animations.

The core animations must be always tagged just like the Name of the State ID.

Exit Transitions

The Idle State is the only one that needs exit transition

To play random Idle Animations you need to add the Random Behaviour to the Idle SubState Machine and then set the entry transitions to different random values within the Random Behaviour Range Value:

Using Higher Range values on the Random Behaviour with just a few animations, it will give more priority to some animations more than other.

In the Image example.

  • [Idle] will be played more if the Random value is between (0 - 6)

  • [Idle Look] will be played if Random is = 7

  • [Idle Look Opp] will be played if Random is = 8

So [Idle] will be played more often.

Last updated