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

How to replicate AnimationTrack to the server?

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()

1 comment

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

1 answer

✓ Accepted answer

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.

1 comment

0

Thanks I didn't know you could do it that way!

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