I have been trying to animated a rig but i dont know how. this is my first time so i dont really know what im doing but i have made the animation ID and all of that stuff, but i just dont know how to place it within code. also i dont want to use it in a person i just want the rig to do it, like it just dancing on a click of a oart if that makes any sence
COMMUNITY QUESTION
How do i animated a rig on a part click?
1 answer
Create a ClickDetector in the Part, then, in the part. Create a Script. Also, create a Animation in the part and change the animation ID to that animation ID. In the script, write this:
local ClickDetect = script.Parent
local Anim = script.Parent.Parent.Animation
ClickDetect.MouseClick:Connect(function(player)
local Humanoid = player.Character.Humanoid
if Humanoid then
local Track = Humanoid:LoadAnimation(Anim)
Track:Play()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
