Support Forum

Adding animation to walking and stoping?

So I started programming a month ago and I’m using this A.I for my enemies. My problem is that I want to add walking when the enemy walks towards my player, and an Idle animation when he reaches the end of the grid and stops in place. I usually add an Animator at the start and then use some like animator.getbool (isWalk, true) and then add it after an “if” condition. This is what I did with the basic controls of my main character. But this code is very advanced and I’m pretty new. Does anyone know how to add animations to the movement and for what script? I tried adding it to the AiPath, don’t know if that’s where I should add it to.

Thanks!

Hi

You can look at the MineBotAnimation.cs script for an example. That’s the script which generates the animation data for the example scenes. It sets a NormalizedSpeed field on the animator which can be used to play the walk/idle animations.