How to make animation play properly when tool is equipped?
Ok, so it's not as simple of an answer as you might think. Making an animation when equipping a tool is easy, but playing it properly is where I have a problem.
What I mean by that is when you equip the tool it takes a few milliseconds for the animation to load and play, and when I make an equipped animation it will play after those few milliseconds, making the whole equipping thing weird because the tool can be seen in idle position and only after like 0.1 seconds the equip animation plays. What I'm trying to achieve is that the tool doesn't show up to the player once the animation has begun.
TLDR: the animation plays with a small delay, making the equipped animation play only 0.1 seconds after the tool is equipped.
01 | local Tool = script.Parent |
02 | local anim = Tool:WaitForChild( "Animation" ) |
03 | local Players = game:GetService( "Players" ) |
07 | Tool.Equipped:Connect( function (Mouse) |
08 | local player = Players:GetPlayerFromCharacter(Tool.Parent) |
09 | local animation = player.Character.Humanoid:LoadAnimation(anim) |
GOAL: Make the animation play immediately when the tool is equipped, or don't show the tool for the small amount of time animation takes to load.
NOTE: If you have the idea of making the tool invisible then visible after a small amount of time don't bother answering, having 10 meshes each with unique texture in the tool makes it unethical to change the visibility of them all.