CreatureState Class

Summary

Base class for the various states a Brains.Creature can be in and actions they can perform.
graph BT Type-->Base0["StateBehaviour<CreatureState>"] Base0-->Base1["MonoBehaviour"] Type-.->Interface0["IOwnedState<CreatureState>"] Type-.->Interface1["IState<CreatureState>"] Type["CreatureState"] class Type type-node Derived0["FlinchState"]-->Type click Derived0 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/FlinchState" Derived1["DieState"]-->Type click Derived1 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/DieState" Derived2["RespawnState"]-->Type click Derived2 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/RespawnState" Derived3["AirborneState"]-->Type click Derived3 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/AirborneState" Derived4["IdleState"]-->Type click Derived4 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/IdleState" Derived5["AttackState"]-->Type click Derived5 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/AttackState" Derived6["LandingState"]-->Type click Derived6 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/LandingState" Derived7["LocomotionState"]-->Type click Derived7 "/animancer/api/Animancer.Examples.AnimatorControllers.GameKit/LocomotionState"

Syntax

[AddComponentMenu(Strings.ExamplesMenuPrefix + "Game Kit - Creature State")]
[HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(AnimatorControllers) + "." + nameof(GameKit) + "/" + nameof(CreatureState))]
public abstract class CreatureState : StateBehaviour<CreatureState>, IOwnedState<CreatureState>, 
    IState<CreatureState>

Examples

3D Game Kit

Attributes

Type Description
AddComponentMenu
HelpURLAttribute

Properties

Name Value Summary
Creature Creature
The Brains.Creature that owns this state.
FullMovementControl bool
Indicates whether the root motion applied each frame while this state is active should be constrained to only move in the specified Animancer.Examples.AnimatorControllers.GameKit.CreatureBrain.Movement. Otherwise the root motion can move the Animancer.Examples.AnimatorControllers.GameKit.CreatureState.Creature in any direction. Default is true.
OwnerStateMachine StateMachine<CreatureState>
The Animancer.FSM.StateMachine`1 that this state is used in.
RootMotion Vector3
Some states (such as Animancer.Examples.AnimatorControllers.GameKit.AirborneState) will want to apply their own source of root motion, but most will just use the root motion from the animations.
StickToGround bool
Jumping enters the Animancer.Examples.AnimatorControllers.GameKit.AirborneState, but UnityEngine.CharacterController.isGrounded doesn't become false until after the first update, so we want to make sure the Animancer.Examples.AnimatorControllers.GameKit.CreatureState.Creature won't stick to the ground during that update.

Methods

Name Value Summary
Reset() void