Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animation works in Roblox Studio but does not works ingame and has no errors, why?

I'm making a game and there is supposed to be an NPC playing a animation, in studio it works perfectly! But ingame it doesnt. Here it is:

a = Instance.new("Animation")
a.AnimationId = "https://www.roblox.com/AssetID?=2103144653"
ta = nil
p = true
if p == true then
	c = script.Parent.Humanoid
	trackanimation = c:LoadAnimation(a)
	trackanimation.KeyframeReached:Connect(function(kf)
	end)
	trackanimation.Looped = true
	trackanimation:Play()
end

2 answers

Since it works in studio and not in server it should be a latency problem, this happens because in studio, everything is local so you don't have to wait for a server to create stuff so your local scripts run instantly. In server this doesn't happen.

Make Sure Your Script Is Local one

You can try and add this

repeat wait() until game.Players.LocalPlayer.Character --Add it to the top of the LocalScript

I hope it works for you, good luck.

1 comment

0

I checked it, didn't work.

I was playing with some friends so I tested in studio simulation test. I don't know if studio simulation is like 100% copy of Roblox' original server but it didn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.