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

Why my animation won't work in actual game, but it work at studio?

Asked by 5 years ago

I made my own animation and for some reason it won't work in game, but it work in studio. Please help. This is my local script:

local p = game.Players.LocalPlayer

local c = p.Character or p.CharacterAdded:Wait()

local h = c.Humanoid

local tool = script.Parent.Parent.Parent.Parent

local animation = h:LoadAnimation(script.Parent)

animation.Priority = Enum.AnimationPriority.Action

tool.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() animation:Play() end) end)

0
Are you sure you saved the animation to ROBLOX? And, uploaded the animation in your games studio? BryanFehr 133 — 5y
0
Yes. Gabe_PlayzRoblox 2 — 5y

2 answers

Log in to vote
0
Answered by
3wdo 198
5 years ago

i had this problem before. instead of pressing the x to close studio, go to file, publish to roblox as, and then find your game

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Try for "0" after Play like this: Animation: Play (0)

Script:

local p = game.Players.LocalPlayer

local c = p.Character or p.CharacterAdded:Wait()

local h = c.Humanoid

local tool = script.Parent.Parent.Parent.Parent

local animation = h:LoadAnimation(script.Parent)

animation.Priority = Enum.AnimationPriority.Action

tool.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() animation:Play(0) end) end)

0
what does animation:Play(o) means? Gabe_PlayzRoblox 2 — 5y

Answer this question