So, whenever I this animation is played on the player the first time it won't work. Then you have to wait like 2 seconds and click it for it to officially fully work. How do you make the animation work on the first time?
All my animations are stored in StarterGui, then cloned into the player.
local s = script.Parent
local player = game.Players.LocalPlayer
local anim1 = script:WaitForChild("Backflip")
local enabled = true
local backflip = s.Button
backflip.MouseButton1Down:connect(function()
if enabled then
enabled = false
local animationTrack = player.Character.Humanoid:LoadAnimation(anim1)
animationTrack:Play()
wait(1)
enabled = true
end
end)
Thanks so much if you helped :)

1 comment
I'm guessing that it's because you're using a local script. Local scripts run before the server starts therefore you run the script before your character loads. Try waiting a few seconds then click the button. Tell us the results.