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

Why are my animations only working in studio and not the actual game?

Asked by 3 years ago

Can someone please help explain why my animation gui is only working in studio? is it something with my script or a game setting?

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local Dance = humanoid:LoadAnimation(script.Parent.Dance)

script.Parent.MouseButton1Click:connect(function()
    Dance:Play()
end)

1 answer

Log in to vote
0
Answered by 3 years ago

Try changing the character variable to

local Character = player.Character or player.CharacterAdded:Wait() --if the character doesnt exist itll wait untill the character is added

Also, make sure its YOUR animation, or if its a group game, make sure that the animation is made by the group

Ad

Answer this question