Allow Enemy to idle at destination

Niraj Karki
Sep 21, 2021

2D Mobile Game

Objective: Allow enemy to reach the destination then idle and walk for the next destination doing the same.

First of all create a reference to the Animator component located in child gameobject.

To create the loop of idle and walk, just set the trigger every time the player reaches the target destination which will play Idle animation which has a exit time and plays walk animation thus enabling movement again.

This is the condition for the transition from walk to idle which check if the trigger is set.

This is the transition between idle to walk animation which has an exit time so that it automatically starts walk animation after complete animation is played.

And this is the final result.

--

--