This is my lizard monster.
Fully rigged, has a humanoid, can load and play animations.
I have this animate script.
--loading all animations
local humanoid = script.Parent:WaitForChild("Humanoid")
local walk = humanoid.Animator:LoadAnimation(humanoid.Animator.walk)
local idle = humanoid.Animator:LoadAnimation(humanoid.Animator.idle)
local eyes = humanoid.Animator:LoadAnimation(humanoid.Animator.idleEyes)
local mouth = humanoid.Animator:LoadAnimation(humanoid.Animator.idleMouth)
local tail = humanoid.Animator:LoadAnimation(humanoid.Animator.idleTail)
--the second we load, play idle animation
idle:Play()
--set up events to play and stop walking animation
humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
print("setup")
if humanoid.MoveDirection.Magnitude > 0 then
if walk.IsPlaying == true then
return
end
print("walking")
walk:Play();
else
walk:Stop();
end
end)
This works right up until the event. This is the script that basically every result I check says to use when trying to detect humanoid movement. Through testing, I can confirm that code after the event does indeed run, and the print statement “setup” never prints, meaning the event is never actually fired.
What am I doing wrong?
Edit: Further testing seems to show that yes, the issue does indeed seem to be that movedirection is simply not changing. Why?
NOTE: If it matters, this is in a server script inside the lizard