Why Is My Animation Not Animating?

I’ve been wrestling with this issue for a couple days… Finishing up other work and coming back to this.

I have an animation that says its running - the event I setup fires when it reaches a keyframe I set at the end, at which I have a print statement printing, “Animation has finished”, but the animation, just will not work. I created it using the studio plugin by Roblox, and am trying to run it from a server script.

I can go back and edit the animation from the plugin from the character rig in studio, but as for scripting to get it working in my game, it just won’t seem to play. I’ve also made sure the animation was imported to my group, under which the game is published from… I have some code preceding this that stops the default animation,and the player just stands still, but with the default animation running, the player waves his left arm and right arm is up holding a Tool handle. with the default Animator animations stopped, the right arm is still up holding the tool, but the player model is completely still.

 local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://5447769971" 
local humanoid = char:FindFirstChild('Humanoid')   
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack.Looped = true
animationTrack.Priority = Enum.AnimationPriority.Action
local speed = animationTrack.Length / 2
animationTrack:AdjustSpeed(speed)
animationTrack:Play()
animationTrack:GetMarkerReachedSignal("end"):Connect(function(paramString)

    print(" THE SCRIPT IS WORKING flying animation ended...")

end)

Okay, I think I figured it out. Animations should be run from server scripts if they’re for NPCs, and LocalScripts for players, per the API

Humanoid | Documentation - Roblox Creator Hub