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

How to replicate AnimationTrack to the server?

Asked by 5 years ago

The problem is that my animation is only looping on the client but not on the server (animation priority too). I have tried using remote events but animationTrack turns out to be nil on a server script. I think I am seriously overlooking something. Is there an easy approach to this?

-- LocalScript
local player = game:GetService("Players").LocalPlayer

repeat wait() until player.Character

local humanoid = player.Character:WaitForChild("Humanoid")

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://2653496046"

local animationTrack = humanoid:LoadAnimation(animation)
animationTrack.Priority = Enum.AnimationPriority.Idle
animationTrack.Looped = true

animationTrack:Play()
0
Just open the animation editor and make it loop I don't see why it won't work, also you don't have to make any changes in a server script, a local one will do when it comes to animations because the server trusts the client with animations royee354 129 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I have tried using remote events but animationTrack turns out to be nil on a server script. This means that Roblox doesn't replicate the animation track.

According to https://devforum.roblox.com/t/replicating-animations/101676, the server does not receive modifications to animations like Looped (or Priority, presumably). Make those changes to the animation (as royee354 said) and see if that fixes your problem.

0
Thanks I didn't know you could do it that way! GoldAngelInDisguise 297 — 5y
Ad

Answer this question