Animation handler

Hi. just wanna ask how we can make the dog walk and stop on idle when it reaches the controller’s spot.? and remove the jitter on stop also? thanks in advance PlayCanvas | HTML5 Game Engine

Hi @Genesis_Miranda!

I forked your project and enhanced the project with the things I mentioned below.

You just need to add all animations as a state to the AnimStateGraph and add some conditions to play the correct state at the right time. The page below can help you with that.

You can solve the jitter by replacing the 0 with 0.5 on line 57 of your follownpc.js script. Apart from that the rigidbody component of the dog should be kinematic because a static rigidbody is not supposed to move.


Thank you!