๐Ÿ”นCreate and configure a new mode

๐Ÿšง In Construction

Overview

Modes are groups of Animations/Abilities that can be played on top of the State animations. For example, the animal can Attack while running, Dodge while flying, Receive Damage while falling, etc.

It does not require any specific logic to be applied while these animations are playing. But in some cases, a Mode Modifier can be applied to change some of the effects on the Mode animations.

Here are the steps to add and create a new Mode for the Animal controller.

Please check the Mode Page for a more thorough overview of how modes work.

New Mode ID

You can create a new Mode ID by duplicating an already created one

or going to Assets/Create/Malbers Animations/ID/Mode

The ID value should be a Different value from the already created ones.

You can check all the Default IDs Values here

For this example, I'm creating a new "Pose" Mode with ID = 23

Adding the Mode to the Animal

To add a new Mode to the Animal you simply go to the animal, select the Mode Tab and hit the (+) button on the Mode List.

Abilities

Now that you have a mode added you need to add the Ability or Abilities that will play in that Mode. By default when you add a new Mode a new Ability will be added:

Rename that ability to the animations you want to play on the animator

Animator Parameters

The Mode parameter play modes on the Animator Controller, along with the ModeStatus parameter.

The new Animal Controller 3.3+ Uses also the ModeOn Trigger Animator Parameter

Enter Transition

To set properly the Mode Parameters for the Animator Controller the value combined on a single integer value.

E.g.: Mode [Action = 4] and Ability [Born = 14] combined is equal 4014 using this formula:

ModeIDโˆ—1000+AbilityModeID*1000 +Ability

Setting the Transition to an [Animator State Machine]

To set an Entering Transition condition for a mode and its animations, the Mode value needs to be set in the correct range for the mode you want. Eg Action:

Action Mode ID= 4. so all the Action Abilities Animations will be between 4000 and 5000.

OR

Inside the Animator State Machine, all the internal conditions will use the formula:Mode=ModeIDโˆ—1000+Ability.Mode =ModeID *1000+Ability.

Setting the Transition to an [Animator State]

If you want to add the Transition directly to an Animator State, the condition to play the Mode Abilities is the combined Mode-Ability value.

OR

Loop Transition

Some Mode Animations can loop to themselves, The condition Transition is ModeStatus = -1:

Exit Transition

For exiting a mode it must have two Transitions. Exit and Interrupted

For Interrupting the Mode. Has Exit Time = false and the Condition is ModeStatus = -2

and another for Exiting the Mode. Where Has Exit Time = true and there are no Conditions.

Mode Behaviour

All the Animations need to have the Mode Behaviour attached. This allows the Animal Controller to know when a Mode Starts and Stops playing.

Activating a Mode

There are 3 ways to activate a mode.

By Input

All modes have an Input Parameter that you can connect to the Input Component.

Create an Input on the Malbers Input or MInput Component and use the same name as the Input Parameter.

So when you press the Input designated to a Mode. It will play a random Animation Ability from that mode.

If you want to play a specific Ability Inside a Mode. Each Ability has an Input Parameter that can be also connected to the Malbers Input Component:

By Code

You can use all Mode Methods inside the Animal Controller.. Check them here:

By Zone

All modes can be played if the character enters a zone.

By Reaction

All modes can be played if the character uses a reaction.

Last updated