How to replicate animation track properties?

From what I’m gathering, properties such as looped and priority don’t replicate. I’ve tried a few remoteevent methods but the animationtrack just returns nil on the server’s end. How would I go about doing this? Thanks.

on the server you can use the AnimationPlayed event on the server to detect whenever an animation is played and check the properties like this:

local humanoid = --put humanoid here
humanoid.AnimationPlayed:Connect(function(AnimationTrack)

end)

I’m not sure why you need animation track properties to replicate to the server when the client can continue playing them, but nevertheless, the best way to get tracks currently active on the humanoid is via Humanoid.GetPlayingAnimationTracks. This returns a table of AnimationTracks with all their properties and whatnot.

If you need granular control or a signal fired immediately after the playing of a track, AnimationPlayed (as mentioned above) is something you can look to using. The event is fired with the AnimationTrack instance that was played.

I’m not quite sure how to continue playing the animations on the client without setting looped to true and have it replicate.

An animation that needs to loop should have it’s looped configuration set to true via the animation editor. The looped property of a track should only be used in the case that you need dynamic switches between looped and not.

Animations replicate automatically, just not the actual instance created by LoadAnimation. That’s where the other mentioned functions step in to help.

1 Like