Animations for custom player mesh not working?

I’m trying to make the player play as a creature, but when I try to get the animations for the creature to play nothing happens even though the script should work and it says there’s no errors.
It works perfectly fine when it’s in the workspace but as soon as I put it in StarterPlayer it stops working.

I’ve tried different scripts and changing where the mesh is in StarterCharacter but it just never plays.
What am I doing wrong?

Heres what i’ve done in the workspace,
image

and here’s what I have for the script.

Instance.new("Animation")

local animationId = "rbxassetid://12537074360"
local animation = Instance.new("Animation")
animation.AnimationId = animationId
local hum = script.Parent.Parent.Humanoid
local animator = hum.Animator
local animationTrack = animator:LoadAnimation(animation)

while true do
	animationTrack:Play()
	wait(1)
end

Try ungrouping the model and making it a folder instead. Or, even better, add its own separate animation controller.

I did what you said and gave it the animation controller and put it into a folder and it still doesn’t play

Are you running it from the animation controller’s animator?

It should be, but I’m not 100% sure

Instance.new("Animation")

local animationId = "rbxassetid://12537074360"
local animation = Instance.new("Animation")
animation.AnimationId = animationId
local hum = script.Parent.AnimationController
local animator = hum.Animator
local animationTrack = animator:LoadAnimation(animation)


while true do
	animationTrack:Play()
	wait(1)
end