-
I am trying to animate a custom character.
-
My Issue The code isn’t working and nothing is happening.
-
I have tried I have changed the humanoid hip height but it didn’t work and the character has a Animator.
Here is the code in a In a Local Script in StarterCharacterScript:
local runAnim = script:WaitForChild("WalkAnim") --the walk animation
local humanoid = script.Parent.Humanoid
local animTrack = false --for doing extra code on top
humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
animTrack = humanoid:LoadAnimation(runAnim)
if not animTrack then --if not already plying
animTrack:Play() --play animation
repeat wait() until humanoid.MoveDirection.Magnitude <= 0 --wait into player has stopped
animTrack:Stop() -stop animation
end
end)
Thx for the help