Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
2

How to replicate AnimationTrack to the server?

Asked by 3 months 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 83 — 3mo

1 answer

Log in to vote
0
Answered by 3 months 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 238 — 2mo
Ad

Answer this question