Animations not working

I created an animation for one of the tools in my game, however when I try to play the animation, the character stutters a bit but the animation doesn’t play. If I use the ID of a previous animation I made with the animation editor, it works. I’m not sure if there is an export issue from the animation editor to roblox that is causing this but I have not been able to fix this. Here is my code:

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://11189917631"
local player = game:GetService("Players").LocalPlayer 
local char = player.Character or player.CharacterAdded:wait()
repeat wait() until char:WaitForChild("Humanoid")
local Humanoid = char.Humanoid
local animtrack = Humanoid:LoadAnimation(animation)
animtrack:AdjustSpeed(0.5)
animtrack.Priority = Enum.AnimationPriority.Action4

script.Parent.Parent.Activated:Connect(function()
	animtrack:Play()
	print("playing")
end)

The script does work as “playing” is printed. The tool itself is picked up off the ground using a proximity prompt.

It’s : Humanoid.Animator:LoadAnimation(animation)


Animation still doesn’t play properly :frowning:

Oh I remember this error you need to get the animation in the animation editor and set animation priority to action then export it back
image

Still doesn’t work, I did find however that it only works in a new studio so I’ll have to transfer everything over

That’s weird works fine for me when I try to replicate what you’re trying to do.

Guess it’s just a studio bug, I’ll see if reinstalling works

Try restarting studio and re opening the place and if doesn’t work you can try reinstalling