Hello, I’m making an AI that walks from point to point using pathfinding service. It is using the Humanoid:MoveTo()
function. When it is moving I want to detect that and play a walk animation using Humanoid:GetPropertyChangedSignal('MoveDirection')
The issue is that the humanoids MoveDirection doesn’t update when it is moving. I have no idea why? This means that the animation never plays because the property is never updated. Is movedirection only unique to a players character?
The rest of the code:
hum:GetPropertyChangedSignal('MoveDirection'):Connect(function()
print(hum.MoveDirection.Magnitude)
if hum.MoveDirection.Magnitude > 0 then
idleanim:Stop(.5)
if not walkanim.IsPlaying then
walkanim:Play(.5)
end
else
walkanim:Stop(.5)
idleanim:Play(.5)
end
end)
Thanks,