Virvek
(Virvek)
November 7, 2019, 3:52pm
#1
When the ais stop moving, the idle animation should play. Which it does sometimes, it seems to be glitched sometimes in the running event.
gif:
https://gyazo.com/f667c3bfbedbb379560def76359ef968
Code:
humanoid.Running:Connect(function(speed)
if speed > 0 then
MoveAnimation(ai,trackanimationmove)
else
dleAnimation(ai,trackanimationidle)
end
end)
Instead of using Humanoid.Runninng, you could just manually apply the animation when they are told to reach the destination and when they’ve reached it stop the animation.
If you’re using MoveTo then you can use the MoveToFinished event.
Virvek
(Virvek)
November 7, 2019, 3:57pm
#3
The animations are client sided, while the server side handles the moveTo events.
Use a BoolValue inside the NPC which is set true when they are meant to move and set false when they have reached the destination.
Then in the LocalScript you can connect on .Changed of the BoolValue, check if it’s true or false and play/stop the animation.
2 Likes
Virvek
(Virvek)
November 7, 2019, 4:00pm
#6
That’s a brilliant idea, I will try that out. Thank you.
1 Like
Virvek
(Virvek)
November 7, 2019, 4:07pm
#7
2 Likes