When I click with a tool it's supposed to play an animation which it does, but it only works AFTER the first click (so I have to click twice before the animation actually plays).
local animation = Instance.new("Animation", character) animation.AnimationId = "rbxassetid://04453025778" local playAnimation = character:FindFirstChild("Humanoid"):LoadAnimation(animation) playAnimation:Play() wait(playAnimation.Length)
*assume that character is already initialized
This is likely because your client needs to load the animation first before it can play it. A lot of times it will not play the animation, or will only play part of it the first time you play it because the client is still loading it.
To avoid this issue you need to Preload
the animation using this... https://developer.roblox.com/en-us/api-reference/function/ContentProvider/PreloadAsync