Animal Controller
📥 Integrations📑 Changelog✅Social
  • 🤝Welcome to Malbers Animations Assets
  • 🌐Discover all my Assets
  • 💫What's New
  • 🌀Upcoming assets
  • 📋Changelog
  • ↗️Upcoming Changelog
  • 🛣️Road Map
  • ✍️End User Licence Agreement
  • 🌟Features
  • Improve Performance Tricks
  • 😓Know Limitations so far
  • 📥Downloads
  • QuickStart
    • 📖Guide to use All Malbers Assets with (AC)
    • 🔼Upgrade to URP
    • 🔼Upgrade to HDRP
    • 💔Common Issues
    • 🔔Tips and Tricks
  • Guides and Tutorials
  • 📺YouTube Tutorials
    • 📺Video Tutorials (On Queue)
  • 📱Mobile Setup Guide
    • Mobile Joystick
  • 🧐How to: Animal Controller
    • 🔹Play a Mode while Moving
    • 🔹Create and configure a new mode
    • 🔊Adding Sound Effects
    • 🔹Rebone Mesh Tutorial (Skin Mesh is Missing)
    • 🔹Add Movement with Non RootMotion Animations
    • 🔹Fetch a ball
    • 🔹Set up Timeline
    • 🔹Make Animal flee when see the animal Player
    • 🔹Animal Controller for Humanoids
    • Create a Shootable Weapon From Scratch
    • ⚔️How to Fix weapons offset and values (Bow, Pistol)
    • ✨Add a Effect to the Effect Manager
    • 🕹️Connect Inputs to the Controller
    • Modify the controller with a Stat
    • Use the Modify Stat Component
    • 📡Use a MEvent and MEvent Listeners
    • 💎Change from Faceted to Smooth poly art Animals
    • ⁉️Listen when an Mode starts or ends
  • 🐎How to: Horse Animset Pro
    • 🐴Call the Mount
    • 🤠Change Meshes for the Rider
    • 🏇Make any animal mountable
  • 🕺Strafing
  • Main Components
    • 🐺MAnimal Controller
      • General
        • Pivots
      • Speeds
      • 🔷States
        • 🕴️Idle
        • 🏃‍♂️Locomotion
        • 🌠Fall
        • 🤾‍♀️Basic Jump
        • 🤾‍♂️Root Motion Jump
        • 🐟Swim
        • 🐊UnderWater
        • 🧗‍♂️Climb
        • 🧗‍♂️Ledge Grab
        • 🦅Fly
        • 🪂Glide
        • 🧗Wall Run
        • 🧗Wall Run Vertical
        • ⛷️Slide
        • ☠️Death
        • ☠️Death Ragdoll
        • 🆕Creating a new State
      • 🟩Modes
        • 🟩Mode Behavior
        • 🟩Mode Sequence
      • 🅾️Stances
      • Advanced
      • Animal Modifiers
      • Events
      • Debug
      • Animal Animator Behaviors
      • Methods and Properties
    • 🎮Malbers Input & MInput
      • Methods and Properties
    • 🤖AI
      • AI Animal Control
      • MWayPoint
      • Wander Area
      • AI Target
      • Animal Brain
        • AI States
        • Tasks
          • General - Chance
          • General - Empty
          • General - Invoke Event
          • General - Send Message
          • General - Play Audio
          • General - Quick Align
          • General - Reaction
          • General - Set Look At Aim
          • General - Set Stat
          • General - Wait
          • Animal - Set Speed
          • Animal - Play Mode
          • Animal - Set/Play State
          • Animal - Set Stance
          • Animal - Set Strafe
          • Movement - Move Stop
          • Movement - Patrol
          • Movement - Set Destination
          • Movement - Set Target
          • Variables - Set Var Listener
          • Weapons - Weapon Tasks
        • Decisions
          • General - AND
          • General - Check Stat
          • General - Compare Stats
          • General - Look
          • General - OR
          • General - Is Task Done?
          • General - Wait
          • Movement - Has Arrived
          • Movement - Check Target
          • Animal - Check Mode
          • Animal - Check Stance
          • Animal - Check State
          • Variables - Check Scriptable Variable
          • Variables - Check Transform Var
          • Variables - Check Var Listener
          • Runtime Set - Is Target in Runtime Set
      • 📌Point Click
    • 🧨Reactions
    • 📶Combo Manager
    • ⚔️Weapon Manager
      • 🛡️MWeapon [General] Properties
      • 🛡️MWeapon [Damage] Properties
      • 🛡️MWeapon [IK] Properties
      • ⚔️MMelee
      • 🔫MShooteable
      • 🏹Bow
    • 〰️Path Constraint
      • 〰️MPath
      • 〰️Path Link (Straight)
      • 〰️Path Link (Cinemachine Path)
      • 〰️Path Creator(Sebastian Lague)
    • Speed Ground Changer
  • Scriptable Architecture
    • 💠Scriptables
      • 🔹Bool Var
      • 🔹Int Var
      • 🔹Float Var
      • 🔹String Var
      • 🔹ValueToString
      • 🔢Variable Listeners & Comparers
      • 🔰IDs
      • 🎫Tags
      • 🪝Transform Hook
      • 📣MEvents
      • 📣MEvent Listener
      • 📦Runtime gameobjects
    • 🔤MLocal Variables
  • Secondary Components
    • ⚔️MDamager
      • 🐾MAttack Trigger
      • 🐾Attack Trigger Behavior
      • 🏉MProjectile
      • 🏹Projectile Thrower
      • 🤯MExplosion
    • 🤕MDamageable
    • 🧊Zones
      • Public Methods
    • ✊Pick Up - Drop
    • ✊Pickable
    • 🚩Respawner
    • 🚩Respawner NPC
    • 🚩Simple Respawner
    • 🏁CheckPoint
    • IK Manager
      • IK Processors
      • Weight Processors
  • Global Components
    • 🧡Stats
      • 🔸Stat Modifier
      • 🔸Modify Stat <Component>
      • 🔸Modify Stat <Asset>
      • 👨‍💻Public Methods
    • Animator Behaviours
      • Message Behaviour
      • Random Behaviour
      • Is Kinematic Behaviour
      • Sound Behaviour
      • Rigid Constraint Behaviour
    • 🟩Trigger Proxy
    • 🔌Interactable
    • ⚡Interactor
    • ⁉️Conditions
    • 🎥Free Look Camera
    • 🎥Cinemachine
    • UI
      • Unity Utils
  • Riding System (HAP)
    • Horse Animset Pro (HAP) Riding System
    • The Art of (HAP)
    • Mount
      • Methods and Properties
    • MRider
      • Methods and Properties
    • Mount Triggers
    • Mount Points
  • Utilities
    • Material Changer
    • Active Meshes
    • Effect Manager
    • Effect Behavior
    • Animator Event Sounds
    • Blend Shapes
      • Blend Shape Preset
    • Look At
    • 🏹Aim
    • 🎯Aim Target
    • 🎯Lock On Target
    • 🐾Steps Manager
    • 🐾Step Trigger
    • 🔗Mode Align
    • 🔗Aligner
    • Component Selector
    • MAnimalAnimatorSync
    • Multiple Time Checker
    • MAnimalAnimatorSync
  • Annex
    • 🗃️Integrations
      • General HAP Integration
      • Rewired
      • Invector Templates
        • Invector Weapon Settings
      • Animals Controller + Invector
      • Ootii's Motion Controller
      • Opsive Ultimate Character Controller (UCC 3.03)
      • Opsive Ultimate Character Controller (UCC 3.08) Generic
      • AStar Pathfinding
      • Unity Input System (NEW)
        • New Input Link [Old Versions]
      • Game Creator
      • Game Kit Controller
    • Contact
    • 🤔FAQ
    • Refund Policy
  • Games using Malbers Animations
  • Interfaces
    • IAITarget
    • IWayPoint
    • IAIControl
    • IAim
    • IAlign
    • IGravity
    • IInteractor
  • ULTIMATE SELECTOR
    • Overview
    • Selector Manager
    • Selector Editor
    • Selector Controller
    • Selector Item
    • Selector UI
    • Selector Data
    • Changelog (Selector)
  • 🎒Malbers Inventory Add-On
    • Overview
      • Compatibility Matrix
      • Roadmap
      • Update Notes
  • Updating from v1.1.1 to v1.2 Instructions
  • Basic Setup Instructions
    • Creating a new Item
      • Adding Buffs/Debuffs to Items
      • Setting up Item Reactions
      • Custom Rarities
    • Setting up Item/Inventory Types
    • Set up the Pick/Drop Component
    • Setting up the Notifications
    • Setting up the Item Info panel
  • Inventory Set
    • Events
  • Inventory Master
  • Notification Manager
    • Notification Child
    • Events
  • Save/Load System
  • Item Spawner
  • Storage Chests
    • Chest Inventory
    • Chest Inventory UI
  • Using Armour
  • Shop System
    • Shop
    • Shop UI Manager
  • Cooking System
    • Create a new Recipe
  • UI Manager
  • Hotbar
Powered by GitBook
On this page
  • Overview
  • Override Start State
  • Clone States
  • Animator
  • General
  • ID
  • Priority
  • State Profile
  • Enter Input
  • Exit Input
  • Reset Input on Failed
  • Always Forward
  • Reset Last State
  • Allow Exit From Anims
  • Can Transition to Itself
  • Exit on Main
  • Enter Cooldown
  • Exit Cooldown
  • Try Loop
  • Duration
  • Can Strafe
  • Strafe Animations
  • Movement Strafe
  • Idle Strafe
  • Tags
  • Enter Tag
  • Exit Tag
  • Exit Frame
  • Messages
  • Use SendMsg
  • Children
  • Animation Tags (additional modifiers)
  • Limits
  • Sleep From State
  • Queue From
  • Reset From
  • Sleep From Mode
  • Sleep From Stance
  • Allowed Stances
  • Debug
  • All included States so far:

Was this helpful?

  1. Main Components
  2. MAnimal Controller

States

PreviousSpeedsNextIdle

Last updated 3 months ago

Was this helpful?

Overview

States are the core logic for the Animal to work. They make the animal move, fall, jump, die, etc.

States are animations that do not overlap each other. For example: the animal cannot be running and jumping at the same time, or Flying and swimming.

They are also sorted by priority, meaning that higher Priority States will try to activate first, followed by the lower priority ones.

If a Higher Priority State is the Active State: Lower states won't try to activate unless the Active State allows it. Using State.AllowExit()will permit again the lower states a chance to activate themselves.

That is why when the Animal is on the Fly state; all the Lower states like Fall, Swim or Jump wont be activated unless the Fly State AllowExit() is called.

Override Start State

Starts the Animal Controller in a custom State instead of initializing in [Idle].

If you want the animal to start with the Fly State then set the Fly ID there

Clone States

This option will clone all the State Scriptable assets at runtime. That way all the animals will have unique States.

If you are using an animal as your Main Player, you can deactivate the Clone State option and modify internal values

All States share common parameters to make easier to change properties to the Animal Controller while the core animation of the State is playing, or a new State or Mode is activated.

Animator

All States require at least one Animation State in the Animator, even though you don't need or have one. you can always create an empty Animation State or use another existing animation clip.

General

ID

IMPORTANT

The Name of the State (E.g. [Death]) Is used and MUST BE SET as the Main Tag for the main animations of that State, otherwise, the controller wont work properly.

Priority

Priority of the State, Higher value -> Higher chance to be activated

This value is set automatically by the Animal Controller in each state. you can modify it on the State list too:

State Profile

Allows different ways of using a State. Setting different values for the same type of State. E.g. If you had 2 flying profiles set up, one could be flying as Iron Man, and the other could be flying using a broom.

Enter Input

Input to Activate the State. This parameter is completely optional, since some States activate automatically, like Swim (when the animal is near the water) or Fall (when there's no ground beneath the animal)

Match the Input with the Input Item Name on any of the Malbers Input Component

There are states that do not require Inputs to be activated, they are activated internally using the TryActivate() method.

Here are a few examples:

  • Idle -> Movement Vector is Vector3.Zero.

  • Locomotion -> Movement Vector is NOT Vector3.Zero.

  • Fall -> There's no ground beneath the Animal.

  • Swim -> The Animal is inside a Trigger with Layer: Water.

You can also Activate any State using MAnimal.State_Activate(StateID state). Just like the health State activates the Death State when Health is Empty. (Check it on Stats component -> Health Stat)

Exit Input

States can be allowed to exit if there's an Input connected to this parameter

Reset Input on Failed

If the state is trying to be activated by an input and it fails for whatever reason (hint - check debug logs for more info!) then you can Reset the input value by toggling this

Always Forward

Mark this as true if you want the character to only be able to go forward in this state e.g. endless runner type of games

Reset Last State

When entering this state, the last state Animator parameter will be reset to -1

Allow Exit From Anims

To Allow to Exit the state, the Animations need to use the [Allow Exit Behaviour] on the Animator.

This is used when states require exit animations and they should not exit from the Main Animation State.

Can Transition to Itself

The state can be activated even when it's already the current state e.g. if you are trying to do double/triple jumps

Exit on Main

Set to true to Try and Exit the state on the Main State Animation. E.g. The Falling Animation can try to exit only when on the Fall Animation

Enter Cooldown

Time needed to activate this state again after exit

Exit Cooldown

Time needed to exit this state after being activated

Try Loop

Try States will try and activate every x amount of frames

Duration

Keeps the state enabled for x seconds, after which It will execute the internal AllowExit() state method - if it's set to 0, this will be ignored

Can Strafe

Allows the character to strafe in this state

Strafe Animations

This state has new Strafe Animations - if set to false, it will not update the animator with the [StateOn] parameter

Movement Strafe

Strafe multiplier when movement is detected - this will make the character be aligned to the strafe quicker at higher values

Idle Strafe

Strafe Multiplier when there is no movement - this will make the character be aligned to the strafe quicker at higher values

Tags

The Tags Modifier Property changes main features on the Animal Controller once the State enters the MAIN Animations on the Animator Controller. The core tag value is the name of the ID - [Speeds]

E.g. when the Animal Enter the MAIN Fall Animation on the Fall State we need:

  • The Root Motion and Sprint to be Disabled

  • Enable the Gravity.

  • Animal to NOT be Grounded or using a Custom Rotation

  • Disable Ignore Lower States (Which Allows Lower Priority States to be Activated in case they can)

  • Additional Positional Speed to be enabled.

Enter Tag

Animator Tag to identify Entering Animations on a State e.g. 'TakeOff' in Fly, 'EnterWater' in Swim

Exit Tag

Animator Tag to identify Exiting Animations on a State e.g. 'Land' in Fall or 'SwimClimb' in Swim

Exit Frame

When this is set to true, and the animal changes from a State to another, The Last State will execute another frame of logic while entering the new State

Messages

When in the state, you can set up messages to send.

Use SendMsg

When sending messages, when toggled true, it will use Unity's built in SendMessage, instead of the IAnimatorListener interface

Children

When sending messages, it will send the messages to all the animal children gameobjects

Animation Tags (additional modifiers)

You can use this section to set up additional modifiers based on when you activate certain animations in the state e.g. FallEdge, or Landing when in the fall state if you want those animations to have slightly different modifiers.

Limits

Limits allow you to set limitations to the states when another state, mode or stance is playing.

Sleep From State

If the Active State is one of one on the list, the state can't be activated.

Queue From

If the Active State is on the queue List. The state will be set on queue until the animal exit the Active State.

E.G. the Death State will be set on queue if the Animal is on the Fall State. and It will be activated once the Fall State finish.

Reset From

If the state exits, it cannot be used again until one of these states on this list get's activated. E.g. You can disable Fly, and not use it again until the character uses idle or locomotion etc.

Sleep From Mode

If a mode is Playing (E.g.: Attack, Action ) you can send a state to Sleep using the Sleep from Mode list. E.g.: The animal cannot Jump while is attacking.

Sleep From Stance

If a stance is playing, you can send a state to sleep whilst the stance is playing. E.g. Whilst in the balance state for walking across a tightrope, you cannot jump etc.

Allowed Stances

You can set stances that are allowed to be played whilst in this state. Leave empty to include all

Debug

When the Editor is on Play mode the State.Debug() function is called.. and every State enables its gizmos and Log.

All included States so far:

Unique for the State that helps identify every state. These are added automatically when a State is created

Find out here what every does.

Eg: the State is set to Sleep when the animal is on the , , and State

| | | | | | | | |

More States will be added on the future with the addition of new Animals

🐺
🔷
😁
Animal Modifier
Jump
Fall
Fly
UnderWater
Idle
Locomotion
Fall
Basic Jump
Rootmotion Jump
Swim
UnderWater
Climb
Fly
Death
ID
The name of the Input [Jump] matches with Malbers Input Jump slot
The Climb State can exit if the Crouch Key is pressed (See Steve)
Climb State require Exit Animations
Check the State List: The Jump State that is set to [Sleep] while is on Fall or Fly
Check the State List: The Jump State that is set to [SleepM] while an Attack is Playing