I made several animation tools that can be divided in two categories. Some are looped animations, the others are just playing once. Here’s an image of my Workspace:
The Animation always contains the AnimationId (e.g. rbxassetid://4264422248)
Now to my problem: All looped animations only load in Studio while all non-looped animations only load in actual Roblox. Here some Pics of my scripts:
I’m not sure if this still happens but what I think is happening is when you do LoadAnimation() it takes a few seconds to actually load, so when u attempteed to play it it didn’t work because it didn’t load yet
I would recommand to preload the animation then play it
local Character = nil; while Player.Character == nil or Player.Character.Parent == nil do wait() end Character = Player.Character
local Humanoid = Character:WaitForChild(“Humanoid”)
local Track = Humanoid:LoadAnimation(script:WaitForChild(“Animation”))
– if your wondering why i didnt use characteradded:Wait() its because i need the character parented under workspace
– tool event function thingy
Track:Play()
I believe the variable for the AnimationTrack only needs to be assigned once at the start of the script. And instead of destroying it, just call :Stop()
A “failed to load error” means that the asset isn’t approved for the game. For an animation to load on a game it must have been created by the game owner, or in the game owners inventory.