Basically, i am making a tool and i need an animation to play when it is activated, i’ve tried this before but it didn’t quite work so can anyone tell me how i can do it please?
I am not asking for full scripts, just teaching me how to make it would help.
If you want an animation to play when the tool is activated then you need to check for the player’s character. Checking it in local script is pretty easy something along this should work.
-- Local script
local Player = game.Players.LocalPlayer -- Get local player
local Animation = script.Parent.Animation -- An Animation
script.Parent.Activated:Connect(function()
if Player.Character and Player.Character:FindFirstChild("Humanoid") then -- Check if character exist and humanoid within character exist.
Player.Character.Humanoid:LoadAnimation(Animation):Play() -- Loads an Animation onto a Humanoid then plays it.
end
end)
I’m not sure about the new Animator thingy yet. I suggest your animation priority should be set to Movement if you want make an idle animation, Action is mostly used for attacking animation such as swinging a sword.