🧗♂️Climb
(Simple Climb)
Last updated
(Simple Climb)
Last updated
The Climb State is a basic climbing logic (Zelda Botw style) that moves the animal on the surface of a wall.. Its State ID is 7.
To create a new Climb State Click the [ + ] button on the States list
Or just duplicate any of the already created Climb States Assets of any animal you own and drag it to the States List.
The state should have a higher priority than Idle, Locomotion and Fall. but below Death, since the animal can be killed at any time. Remember States work by priority; If you need to Jump or Fly while the animal is in the Climb state, those states should be above Climb.
When the animal is in this state, all the Lower priorities states are ignored until the exit conditions for this state are fulfilled.
All Climbable surfaces need to have a collider be with the Material "Climbable"
All Climbable surfaces must have the same layer as the Climb State Layer Parameter:
The climb state uses the Climb Pivot Values to detect climbable surfaces.
You need to select on the State List of your character, the Climb State. In order to see the gizmos
If the rays detect any of these surfaces, use the Climb State Input value to Start the state.
In the case of the Human and the Racoon, I use the same Input for the Action Mode. So if the Raccoon press <E> it will start climbing.
Set the Automatic Parameter to true and the Animal will activate the State as soon the Ray finds any climbable surface.
Zones can also be used to activate the state. Set a zone in front of a climbable surface and the State will be activated.
Animal Reactions can be used to activate the state. Check Reactions
Internally, the exit conditions will be executed to check if the State can exit.
Since all Exit Conditions need Animations, all Exit Animations require the AllowExit Behavior in them.
When the animal is Climbing Down (Pressing the S Key to Move Down); a Ray will be cast to search for the ground beneath the animal. If the ray touches the ground. This exit condition forces the Idle state to be activated after.
The animal will cast 2 Rays to find a Horizontal ledge. If it finds it then it will play the Ledge Exit Animation. This exit condition Forces the Locomotion state to be activated after and sets the StateExitStatus to 1.
The Wall does not have the <Climb> Material Surface. This condition allows lower-priority states to be activated.
Any high-priority states can be Activated, forcing the Climb state to exit:
Pressing the Exit Input State the state will exit too
The basic setting for the Climb state is very similar for all the animals.
Main Tag [Climb]
☑️RootMotion
☑️Sprint
◻️Gravity
◻️Grounded
☑️Custom Rotation
◻️Orient To Ground
☑️Ignore Lower States
◻️Persistent = False
◻️Lock Move
◻️Lock Input
☑️+ Root Speed = True
☑️ + Pos Speed
◻️ Free Movement
Sleep From State: (OPTIONAL)
Underwater, Fly. You don't want to use the climbing when those states are active
Sleep from Mode (OPTIONAL)
Attack, Action. You don't want to use the climbing when those Modes are active
Queue From <None>
The Climb state requires the Animation States that are in charge of the Climbing movement.
All States have a core animation on which the Animal will stay while the state is active. In case of Climb will be the Climb BlendTree Animation state.
This core animation must be always tagged just like the Name of the State ID.
Since the State is a moving state, the Speed Multiplier must be set as Parameter "SpeedMultiplier"
This Climb Blend Tree is usually set this way:
It uses 8 Directional animations to move around the surface
If you don't have all the animations, you can fill the missing states with duplicate animations
To have a smoother state Climb should have extra animations to transition to and from the core animations.
Climb Start is used when the Last State is Idle or Locomotion to quickly align the Animal to the Wall while the animation is playing.
This animation must be tagged as <ClimbStart>
The Enter Transition is Last State < 2 (Meaning the last state was Idle (0) or Locomotion (1) )
This Exit Animation is Activated when the animal is going down. Pressing the S Key.
This animation is tagged as <ClimbExit>
The Enter Transition from Climb is StateExitStatus = 3. Just like the value set in ClimbDown
Grounded = True can be used on the transition as an alternative.
This Exit Animation is called right after the <Climb Up a Ledge> conditions are fulfilled.
The Tag used on the Animator State is <ClimbEdge>
The Enter Condition is Exit Status =1. Just like the value set in the parameter Climb Ledge
Tag Modifiers change properties on the Animal Controller every time the Animal enters an animation with any of the included tags on the list.
The Climb needs a new Speed Set that affects the State
If your Climb animations are NOT RootMotion Animations, increase the Position and values to be greater than zero.
Layers needed to detect climbable colliders.
Surface Material needed on the colliders to recognize Climbable surfaces
When this parameter is true, the animal will climb automatically a surface if is near it
Values to set properly all raycasts needed to climb Climbable surfaces.
Pivot to cast a ray from the chest.
Pivot to cast a ray from the hip.
Lenght of both Hip and Chest Rays
Radius of the Rays to detect walls
When aligning the Animal to the Wall, this will be the distance needed to separate it from it.
Smoothness value to align the animal to the wall.
Distance from the Hip Pivot to the Ground. This value is used to find the ground while the animal is climbing down. Using the S key. Is represented by a White Ray.
These represent 2 rays to detect Inner 90-degree corners to position the character to the right spot when detected.
If the Ray touches an inner 90-degree wall, a quick alignment will occur
Use this if you don't have turn-inner corner animations
Additional Speed used to move faster around the outer 90 corner
Use this if you don't have turn-outer corner animations
Value of the State Exit Status value on the Animator to Activate the Climb Ledge Animation
Value of the State Exit Status value on the Animator to Activate the Climb Off Animation
Value of the State Exit Status value on the Animator to Activate the Climb Down Animation
These parameters are used to Detect a ledge when the Animal is Going Up
Relative Offset Position to Cast the First Ray on top on the animal to find the ledge. Its represented by a Red Ray
Length of the Ledge Ray
Minimum Distance needed to Activate the Exit Ledge Animation. If the Second Ray Distance to the surface is greater than this value, the StateExitStatus parameter will change the value to Climb Ledge.