Animation NOT REPLICATING TO SERVER!

Yes, this is a really legacy problem. I’m sorry if I’ve asked about a topic which has been asked a lot of times on the DevForum but I never find a concrete solution.

The title has spoken for itself: Animations are nott replicating to the server. I’m not certain about the initial reason for this, but the major problem is this doesn’t happen all the time, sometime it does, sometime it doesn’t. What I’m doing is simply call :LoadAnimation on client, and the animation instance is both visible by client and server. Some of them are stored inside ReplicatedStorage, and some of them are stored inside the player’s character descendant. I’ve also try using Humanoid.Animator:LoadAnimation() instead of Humanoid:LoadAnimation(), but I think they both generate the same output.

Recently I decided to rewrite the Roblox’s default Animate script and merged it with my client main code such that it will be compliable with some of my other code. Basically the only thing I do is read the humanoid state and play the corresponding animations. These movement animations (Idle, Walking, Jumping and along with my sprinting etc.) are all in the lowest animation priority. While my tools’ animation’s priority varies from the above three priority. They’re being played separately. Before I implement my own animate system, this does not happen. I’m not sure does that have to done with something related to Animation Priorities, but in my case, I can not change the priorities since they’re used by other animations.

Last but not least, I’ve tried out nearly all the solutions that I could find. I included the AnimationWeight Priority in LoadAnimation:Play(), I tried all the values but it changes nothing except the appearance of the animations. I also tried :WaitForChild(“Animator”) on client, and I even yield the server to wait for the Animator and Send the animator object through RemoteEvent to the client to reference it. Then call LoadAnimation:Play() base on the referenced Animator, sadly it changes nothing. This keep happening from time to time. Note that I can not load animation nor play animation in the server for my case because the animation changes from time to time, and it will be even worse if I play it on server because there will be a huge sight delay.

One last piece of information is: I tried to print Animator:GetPlayingAnimationTracks() when this happens on player, it appears to be an empty table, which means no animation is playing, aka no animations is being replicated to the server.

Here’s the code of how load the animation.

		repeat warn ("Awaiting animator") wait() until hum:FindFirstChildOfClass("Animator") ~= nil
		Animator = hum.Animator
		loadCoreAnimations = {
			{Name = "idle", state = nil, loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("idle"))};
			{Name = "crouch", state = "CROUCH", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("crouch"))};
			{Name = "crouchWalk", state = "CROUCHWALK",loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("crouchWalk"))};
			{Name = "ads", state = "ADS", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("ads"))};
			{Name = "fall", state = "FREEFALL", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("fall"))};
			{Name = "jump", state = "JUMP", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("jump"))};
			{Name = "climb", state = "CLIMB", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("climb"))};
			{Name = "swim", state = "SWIM", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("swim"))};
			{Name = "walk", state = "WALK", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("walk"))};
			{Name = "sprint", state = "SPRINT", loadAnim = Animator:LoadAnimation(CoreAnimations:WaitForChild("sprint"))};	
		}

.

		Animations.Idle = Animator:LoadAnimation(Tool.Animations.IdleAnim)
		Animations.Idle2 = Animator:LoadAnimation(Tool.Animations.Idle2Anim)
		Animations.Equip = Animator:LoadAnimation(Tool.Animations.EquipAnim)
		Animations.Shoot = Animator:LoadAnimation(Tool.Animations.ShootAnim)
		Animations.Reload = Animator:LoadAnimation(Tool.Animations.ReloadAnim)

Also a screenshot of it happening on other players.

Sometimes this can be a issue with priority.

When you do LoadAnimation it should return a table/object.

So a pseudo example would be this:

local Animation = Humanoid:LoadAnimation(AnimationObject)
Animation.Priority = Enum.AnimationPriority.Action

I forgot if it’s Core or Action that has the highest priority

prob Action because Core is the default settings when u create an animation and it does not work
so prob action cuz it works

Ya, that makes the most sense.

Sorry but in my case, I can not modify animations priority since higher priority has been occupied by other animations.

It’s not wrong to make all of them Actions (High Priority)
what important is that it works
I have a game where I ran multiple Animations at once (Action priority)

It will play both animations in Action Priority only if the second one was play after the first one. Let’s say I have a Tool idle animation and a sprinting animation. They both uses the player’s arm, if:

  • Player equips the tool, idle plays, arms up.
  • then he sprints, which the sprint animation’s arm will overlay it.

That’s why I use lower priorities for some animations.

Then you just have to configure when will certain animation plays
I have my own check if an animation players the other won’t.
that’s the only solution I’ll provide.
but conclusion is, all action priorities, some checks and configurations

Thanks for your suggestions but I don’t think I will be able to apply it, if I can only play one animation at once, it will take up to thousands of animation. Such as Shoot with legs idle, shoot with legs running, reload with legs idle etc.