🤾♂️Root Motion Jump
<done>
Last updated
<done>
Last updated
The Jump state is in charge of allowing the character to Jump. Its State ID is 2. This State uses Root Motion Animation to have more precise Air and Land Movement while jumping.
Root Motion Jumps look like this:
Which are divided on JumpStart, JumpAir and JumpEnd.
When the state is activated.. the animation will be activated. The starting position will be store to later compare the Height of the Jump according to the ground. When the jump height is on its peak a raycast will be executed to check if the Animal can complete the jump with the Jump End animation or it will go to the Fall state.
To create a new Swim State Click the Plus button on the States list:
Or just duplicate any of the already created Jump 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.
If you want your Character to jump while in the water: Jump should be above Swim in the State list.
Higher Priority states will prevent lower priority states to try to activate themselves.
The basic setting for the Water states are very similar for all the animals
ID = Jump State ID
Input: Jump
General
RootMotion = True
Sprint = true
Gravity = false
Grounded = false
Custom Rotation = false
Orient to Ground = false
Ignore Lower States = true
Persistent = true
Lock Movement = false
Lock Input = false
Additional Position Speed = true
Exit Frame = true
Sleep From State: 1
Fall (Avoid Jumping while the Animal is falling)
Sleep from Mode: 2
Action (Avoid Jumping while making an Action)
Attack1 (Avoid Jumping while making a Main Attack)
Queue From: 0
Tag Modifiers: 2
JumpStart
JumpEnd
The Jump State has a “JumpStart” and "JumpEnd" Tag Modifier by default. This allows the Jump state to have an entering and exiting animation for jumping which it will modify core parameters on the controller while it is playing the Enter and Exit Jump Animation.
The values for the Animal parameters that the Jump Start modify are:
The values for the Animal parameters that the Jump End modify are:
The Jump State requires Root Motion Jump Animations. All Malbers Animals and creatures have this animations. If your character does not have RM Jump Animations, is recommended to use the Jump Basic State instead.
The Jump State require Animations states that makes the animal Jump.
Inside the Jump Sub-Animation State you will find more Sub-States that are activated by the current Vertical Speed the animal uses.
For Example the Jump Forward will be activated if the Vertical Speed is greater than 0.1; Jump Run will be activated if the Vertical Speed is greater than 2.1
Each Jump Sub-Animation State are divided in 3 Animation States.. Jump Start, Jump Air and Jump End.
This States have their own Animation Tag, that correspond to the Jump Tag modifier list..
For example Jump Forward Start have the Tag JumpStart. That way the controller can know which Animation for the Jump is currently playing and then it can apply the proper controller modifications.
Jump Start Animation have "JumpStart" Tag
Jump Air Animation have the "Jump" Tag
Jump End Animation have the "JumpEnd" Tag
All Jumps Animations are Split it 2 Types. Baked, and Non Baked on the Y Axis.
The Start and End Jump uses the [Baked] version of the Animation.
The Air Jump use the [Non-Baked] version.
The same Exit time and Transition offset.
Has Exit Time Enabled.
Transition Duration should have a very small value (0.01 ~ 0.1)
No Conditions
Modify the Exit Time and Transition Offset values until you have the correct number. So when you scroll the Preview Animation window, the Root should remain on the ground until the Animal take off with the jump:
In this case you can create new transitions for the Locomotion Exit to be specific to Jump with a more smaller value on the Transition Duration. In this case Locomotion has new Exit Transitions with different Transition Duration to be applied when the next state is Jump.
The same Exit time and Transition offset.
Has Exit Time Enabled.
Transition Duration should have a very small value (0.01 ~ 0.1)
No Conditions
Modify the Exit Time and Transition Offset values until you have the correct number. So when you scroll the Preview Animation window, the Root should be on the air until the Animal land with the jump:
Has Exit Time Disabled.
Transition Duration = 0.2 ~ 0.4
Condition [State != 2]
This transition is used when the Animal changes to Fly or Fall while is Jumping.
The transition from End to Exit should have:
Has Exit Time Enabled.
Transition Duration should have a very small value (0.01 ~ 0.2)
No Conditions
If the Jump Input is pressed the animal will keep applying the Jump Y Root Motion movement.
Smoothness value to change the Jump Y root motion movement value.
Amount of rotation the animal can do while is on the air.
Allows Rotating the wolf while jumping and falling.
It Set the proper values for each Jump based on its vertical speed.
Jump profiles should be set from lower to higher vertical speeds.
Name of the Jump Profile. Click on the name to rename it.
The vertical speed allows to use the correct Profile for the correct Jump Animation
E.g. for Jumping in Place Animation it will use the Vertical Speed of 0, for Forward jump it will use the vertical speed of the animal between 0 and 1... and so on.
Fall time is the Normalized time on the Jump animation you want to check if the animal can transition to a fall animation ... usually is the time after the animal is on its highest point of the jump animation. you can find it by scrolling the Jump animation:
Jump Ray and Fall time are used together.. the value of this parameter is determined by the Fall Time value.
This value is used to cast a ray from the Chest Pivot of the animal to the ground to find if there is ground beneath him. if the Rays fails then it will transition to the Fall animation.
To find the proper value drag the animal to an empty scene and perform several jumps with a Higher Jump Ray Value. Enable the Debug Option on the Jump State and the Console will show the Min Distance to complete a Jump.
E.g. for the Wolf Jump In place the value to complete the In Place Jump is 1.74. So on the Jump Profile is set to 1.8 (to add a little margin for small steps or small changes on the ground)
If the Ray cast does not find any ground beneath then it will go to the Fall State
Normalized time range to find higher ground while jumping)
Cliff Ray Length to check for higher ground.
The Cliff Ray is represented by a black line (is visible from the Cliff Time 0.6 and 0.8 normalized time of the Jump animation). If this ray finds a higher ground it will interrupt the Jump and it will go to the locomotion state.
Multiplier to add more Height to the Jump Animation
Multiplier to add more Distance to the Jump Animation
The order of the Transition is very important too.. when the Jump State is activated it will check the transitions by its order. Jumps with Higher Vertical speed should be set first.
The transition from Start to Air should have:
The transition from [Air] to [End] should have:
The transition from [Air] to [Exit] should have:
Exit Time must be greater than the Exit time value of the Transition (Air to End)