i did an animation and export it, the animation is for a custom character i made, i have all the joints and welds and humanoidrootpart, and a primary part as well
the script has no error either
local character = script.Parent
local humanoid = character:WaitForChild(“Humanoid”)
local walkAnim = script:WaitForChild(“Walk”)
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)
humanoid.Running:Connect(function(speed)
if speed> 0 then
–play animation
if walkAnimTrack.IsPlaying then
walkAnimTrack:Play()
end
else
– stop animation
if walkAnimTrack.IsPlaying then
walkAnimTrack:Stop()
end
end
end)
I think your problem is at the line where your code says the walkAnimTrack variable, i dont realy understand why you typed humanoid.Animator but insted type humanoid:LoadAnimation(walkAnim) , this should do
I loaded the code into a blank place with a placeholder walk animation and it works for me. All I can suggest at this point is to make sure that the priority of the animation is not Core so that it plays over top of the default animations.
Just in case, here’s how I implemented the code:
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)
humanoid.Running:Connect(function(speed)
if speed> 0 then
if not walkAnimTrack.IsPlaying then
walkAnimTrack:Play()
end
else
if walkAnimTrack.IsPlaying then
walkAnimTrack:Stop()
end
end
end)