Hi! My goal is to play animation while player is standing still. Here is a code I wrote:
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal('MoveDirection'):Connect(function()
print("I am moving around")
if humanoid.MoveDirection.Magnitude == 0 then
print("I am standing")
end
end)
This code works but my output is going crazy! That’s why I am not sure if that’s the most efficient way to do it. (correct me if I am wrong)
Here are things I have already tried:
- Detecting the change of Velocity in player’s UpperTorso (didn’t detect a change)
- Detecting Humanoid:StateChange() (came to conclusion that there is no state for standing still, defoult state is running)
Thanks!