Custom Character Animations Not Working

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)
1 Like

Aren’t you able to do this just by doing this, or is your use case different?

1 Like

why are you using 2 different animators? why not just use the animator under humanoid for everything

1 Like

sorry i was trying something and i forgot to remove those but it made no difference

1 Like

make sure animation priority is set to action or atleast higher than base

1 Like