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

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

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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.

0
I checked it, didn't work. Salvestroni2 5 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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.

Answer this question