Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to detect if NPC is walking??

Asked by 6 years ago

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?

0
you can also check their velocity but matt's is easier User#19524 175 — 6y
0
mattscy it worked well, thanks :D KrzysiekRoblox 50 — 6y

1 answer

Log in to vote
0
Answered by
Aimarekin 345 Moderation Voter
6 years ago

You can use the :GetState() function of the humanoid to know if the character is running.

The :GetState() will return an Enum, the HumanoidStateType.

0
Ok, I'll try it out :D KrzysiekRoblox 50 — 6y
Ad

Answer this question