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 :)
You can play all the animations on a bot each time a player gets in the game, so it will be loaded for player. You can play an animation on a bot by using an AnimationController. Here's an example which you can find in Wiki
local animController = Instance.new("AnimationController") local animTrack = animController:LoadAnimation(animation) animTrack:Play()