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.