Hi,
I have a custom character and animations made for the character. You can play as the character but there are no animations. The script prints the lines. The script gives no errors but the animations do not play. I believe the model has the correct joints as it is able to move without the animations.
I’m lost so any help is appreciated.
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local idleAnim = script:WaitForChild("IdleAnimation")
local walkAnim = script:WaitForChild("WalkAnimation")
local eatingAnim = script:WaitForChild("EatingAnimation")
local pickupAnim = script:WaitForChild("PickUpAnimation")
local idleAnimTrack = character.AnimationController.Animator:LoadAnimation(idleAnim)
local walkAnimTrack = character.AnimationController.Animator:LoadAnimation(walkAnim)
local eatingAnimTrack = humanoid.Animator:LoadAnimation(eatingAnim)
local pickupAnimTrack = humanoid.Animator:LoadAnimation(pickupAnim)
print(script.Parent, character)
humanoid.Running:Connect(function(speed)
print("function run")
if speed > 0 then
print("speed")
if not walkAnimTrack.IsPlaying then
print("anim")
walkAnimTrack:Play()
print("played")
end
else if speed <= 0 then
--print("under speed")
if walkAnimTrack.IsPlaying then
--print("is playing")
walkAnimTrack:Stop()
--print("stopped")
end
idleAnimTrack:Play()
print("idle")
end
end
end)