Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why dosen't my animation load to the character when i click on the part?

Asked by 5 years ago
Edited 5 years ago

Im trying to play a anition when click on a part [ClicckDetector] but it dosen't work, any help??

code:

local click = script.Parent.ClickDetector

local Sew = script.Parent

local anim = script.Parent.Animation

-----------------------------------------

click.MouseClick:Connect(function(playerWhoClicked)

playerWhoClicked.Character.Humanoid:LoadAnimation(playerWhoClicked,3122381458)

en

1 answer

Log in to vote
1
Answered by 5 years ago

You need to play the animation using play()

local click = script.Parent.ClickDetector

local Sew = script.Parent

local anim = script.Parent.Animation

-----------------------------------------

click.MouseClick:Connect(function(playerWhoClicked)

Anim = playerWhoClicked.Character.Humanoid:LoadAnimation(playerWhoClicked,3122381458)
Anim:Play()

end
0
My brain.... I'm soo stupid Freddan2006YT 88 — 5y
0
loadanimation requires an animation object..? Freddan2006YT 88 — 5y
0
nvm fixed it myself :) Freddan2006YT 88 — 5y
Ad

Answer this question