The player reaches the destination using the navmesh agent, animation transition is not triggered using SetBool in Unity3d.
Object: Fixing the Player Movement system.
Before doing this let's see how my code and the name of my parameter change the state, the parameter is a bool type.
In the first step, let's play the game and see the problem.
In the second step, let's add debug inside the condition where we check the distance.
If we play we will see the debug is not called, this tells us this condition is false.
In this step, let us move the debug code outside, we do this to make sure the code to calculate distance is working.
Let's play unity, now we see the distance is calculated and the player is stopped at the distance of 1.98. This means the condition is false since we want to stop when the distance is less than one so this show the condition is false.
Now select the player and open navmesh by going to window<AI<Navmesh. Now go to the scene view and check if we have any bake errors.
Note: For the player to stop walking is when green cylinder colliders to map with a red circle mark on the ground, but due to some places is not baked the player can't move.
In this step, let's move the player and see the mapping of the navmesh collider and red circle which means it's the destination of the player.
Note: Green cylinder collider map with red but idle animation is not triggered due to the distance being greater than the stop distance of the navmesh agent. So seem the player does not reach the destination for the condition to be true.
In this step lets, make the player model touch the ground and the parent player object touches the ground and set the base offset to 1. When you make the player parent touch the ground make sure the cylinder collider does not go inside the floor and make Daren touch the floor.
Now play the editor, this is how I solve this issue,
See you in the next article