Hello. I'm trying to create NPC. I made a script, so it walks around in different direction (I used math.random).
To make NPC walking, I used MoveTo() function.
Now, I'm adding a walking animation, but I don't know, how to make script that plays animation only when NPC is moving. Can somebody help me?
You can use the :GetState() function of the humanoid to know if the character is running.
The :GetState() will return an Enum, the HumanoidStateType.