Client played animations randomly not replicating to the server

I’ve been encountering a rather annoying bug for a about month now. It sprung out of nowhere, we released an update and all of a sudden players started reporting that their they couldn’t see other player’s animations. (The update was completely unrelated, I fixed some UI issues) The issue happens seemingly at random, while the client is playing the game, and therefore playing animations, and they play some animation, its entirely random, and all of a sudden every animation that’s played on their humanoid stops replicating. (https://streamable.com/nrvgn) (https://streamable.com/dt2zs) Both streamables show it in action.

I’ve gone up to a year and a half into the DevForum and have only found one post with what appears to be the same issue as me, the creator of the post never got back to me if they had a fix, as their post was locked with no solution. I’ve already checked that every part in the character for improper network ownership, all parts are owned by the corresponding player, we don’t do anything to the character that might stop replication, like anchoring, or removing/altering and of the joints. All we do is use the default method for playing animations, calling LoadAnimtion(). and using Play(). All of our animations have the proper priority.

If you look closely in the second example of this issue (the one with the grey ground) you’ll see that the default punching animation played fine, but once something triggered the whole issue, animations that replicated stopped replicating. I’ve checked pretty much every DevForum post that had any similar issue and tried everything that was mentioned or suggested to be tried and ultimately haven’t gotten anywhere. I’m not sure at this point of the fault is on us or on some external factor.

5 Likes

I’ve had this happen before on some of my games. I think it’s a bug but I never confirmed it. If it’s not a Roblox error, it must be in how you load your animations and play them.

1 Like

I’m not entirely sure its on our end, unless we are loading the animations incorrectly like you say, we load the majority of animations in their related scripts/modules, and they’re all loaded off of animation instances that are kept in the Replicated Storage, below is a snippet of how we load the majority of our animations.

DashBack = MovementAnimations:WaitForChild("DashBack")
DashBack = Humanoid:LoadAnimation(DashBack)
2 Likes

Could we maybe see your animation script? Also, your probably not doing this, but if you are maybe doing this, these changes to the properties of the animation won’t replicate.

local Animation = Humanoid:LoadAnimation(Animation)

Animation.Looped = blah
Animation.TimePosition = blah
Animation.WeightCurrent = blah
1 Like

So the general process for playing animations (the script is far too long to put here all in once) is as follows

DashBack = MovementAnimations:WaitForChild("DashBack")
DashBack = Humanoid:LoadAnimation(DashBack)

Animation is loaded and referenced in a module (not sure if the lack of “local” causes anything weird since its a module)

We then follow some basic game checks, for the animation above we check for the user input being a double tap of the S key, and we check important things like the gameProcessedEvent, and other debouncers that might make the player’s request to dash invalid. (These couldn’t be the cause because the animation wouldn’t play client side if that was the case).

Essentially we just do this

DashBack = MovementAnimations:WaitForChild("DashBack")
DashBack = Humanoid:LoadAnimation(DashBack)
--logic to check if animation play is valid
DashBack:Play()

(We load our animations client side off of animation instances stored in the ReplicatedStorage)

We don’t change any of the animation properties like Looped, TimePosition, or Weight.

We do have some custom alterations to the default animation script, but I’ve discarded that as a cause, because even with a default animate script (ours is up to date, as well as the one I used) the whole issue still occurs

That’s weird, I can’t really do much, but all I can recommend is to try remaking it or removing things one by one and seeing if it fixes your issue…

I’ve actually already tried that, I replaced one of the default combat animations, the first punch you see in both clips, with a random animation/re uploaded version and the animations till triggered the issue. I’ve also tried disabling animations and the result was still the same

No, like remaking the script itself or removing things one by one in the script.

(Sorry for the late response, its been a very busy week)

So I tried removing the animations one by one, to ultimately no avail. Even with just a singular animation the issue still persists. I’ve also tried updating the animation script once again, and re uploading animations, which all have resulted in zero changes to the situation

Have you checked if the animation is the proper priority in the animation editor? Changing the track’s properties in a localscript won’t replicate, so all of the properties such as Priority must be changed in the animation editor for them to replicate as you want.

I’ve already dug around everywhere that even mentions an animation and the only things that are done to them is calling Play() and Stop(), we don’t alter any properties of any animations client or server side.

–Edit

I’ve also checked all the animations we have, I’ve even uploaded new versions of the animations with the priority they should have (in case somehow it doesn’t update on the old id for whatever reason) and those same animations can still trigger the whole not replicating state

–Edit 2

I’ve also looked over every part we weld to the player, both client and server side and all of them are massless, unanchored, and uncollideable, so none of them would cause any issues with animations. Further more if any of them did I doubt the character would enter this sort of weird animationless state they’re in

Maybe try isolating the animation script in a separate game and see if the issue still happens, so you can confirm if this is a roblox bug or an issue with your code

So I made a sort of dud place and added in a few animations (I added the default punching animation cycle). And the issue doesn’t seem to appear, which leads me to believe its something on my end, but I honestly have no idea what would cause a completely random pause to animation replication so infrequently and with such a distinct and weird state on the character as a whole.

–Edit

Also, this entire issue came completely out of nowhere months ago and effected all versions of the game. Yet as far as I know, after scrubbing and looking over mountains of code we don’t do anything that I know of that would result in this random loss of replication for our animations

I’d just move the game over to the separate game piece by piece and test to find out what is causing it

So I worked with another developer (the game is group based) and we took apart everything, we literally had 3 animations playing, no state changes, no welding, nothing out of the ordinary and it still ended up breaking. I’m pretty sure there’s nothing left to really try at this point

Odd, is there any way you can reproduce this, because if you can I’d make a bug report you said someone else was having this issue as well and you took apart everything so it’s probably just a bug

Hi.
Just wanted to make sure you are aware of one nasty behaviour of LoadAnimation(). If it is being loaded to a humanoid without “Animator” object, it will create one rather than throwing an error. Since characters (and Animator) are being created on server and you are using LoadAnimation() on client for player characters (if not then you should), you may end up with two Animator objects. That is especially true when server has a huge workload, and spawns characters rather slowly. Two Animator objects could cause replication issues you are having. Therefore you should always use CharacterHumanoid:WaitForChild(“Animator”) before loading any animations. I have solved similar replication problem (but not the same) in my game thanks to this.Sorry if this is not relevant or you already knew this.
Edit: Humanoid, not Character.

Two Animator objects never get generated, or shouldn’t. The creation of an Animator is a regular instanced object from the server following standard replication rules.

1 Like

From the Wiki

The Animator object must be initially created on the server and replicated to clients for animation replication to work at all. If an Animator is created locally, then AnimationTracks loaded with that Animator will not replicate.

Both Humanoid:LoadAnimation and AnimationController:LoadAnimation will create an Animator if one does not already exist. When calling LoadAnimation from LocalScripts you need to be careful to wait for the Animator to replicate from the server before calling LoadAnimation if you want character animations to replicate. You can do this with WaitForChild(“Animator”).

I may be wrong on two Animator objects, but if LoadAnimation() on client is called simultaneously as the server creates Animator object during normal spawning, i would not count on them to act nicely.

1 Like

Is this happening all the time? Somehow I also counter this in my game but it happens vary and from time to time. It’s also an idle animation. But I found that this does not happen to me anymore since late August, is this still happening to you?