Custom Character MoveDirection not updating?

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,

2 Likes

It is possible that HumanoidStateType (roblox.com) could be updated. Otherwise you should call :ChangeState() when commanding it to walk.

1 Like

Doesn’t seem to work either, it just does exactly the same thing as the MoveDirection did. I have however found a temporary solution, but if anybody has any ideas feel free to share!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.