The animator is in the humanoid. Okay, so the rig is for a gun system, but the rig has the arms welded to a small part that is located at the position of the head. I’m animating an idle animation for them, but whenever they go to switch weapons, the other player cannot see it. Whichever gun the other player has out when your character loads in, you can’t see the arms of the other player when they change to the one that they didn’t have out (the arms are not deleted when changing weapons, but the base part that they are welded to is). Other than a gun that is welded to this same base part, the rest of the rig is a default R6.
All this happens because you are running it on the client, try to run it on the server, if you can’t do it with remote events, that when they are called the script is run from the server, but if you use remote events be careful with exploiters.
I hope to be of help to you in something
Does the animator change itself when parts in the character are removed/added? Could that be the issue as to why the animations aren’t getting replicated to other clients? I’ve made it so the server creates the animations and the client just loads them now, wouldn’t that cause the animations to replicate, or does the animator fail to replicate if you change the character rig through the server?
Okay, I tried one more thing to try and fix this, which I copied the C0 and C1 of the base part and the arms from the client to the other clients, yet this issue still occurred. How could this even happen? All edits to the characters are done on the server, so there should be no difference between the rigs for each client. There are no other instances where the other client could possibly change the C0 or C1 of the arms, so I have no clue what could cause this issue.
I’ve already tried running the animations on the server, yet it still does this same issue.
no, take a look on Animator
The main class responsible for the playback and replication of Animations
. All replication of playing AnimationTracks
is handled through the Animator instance.
It is created when Humanoid:LoadAnimation
or AnimationController:LoadAnimation
is called under a Humanoid
or AnimationController
for the first time.
For animation replication to function it is important for the Animator to be first created on the server.
Should I load an Animation on the client or server?
In order for AnimationTracks to replicate correctly, it’s important to know when they should be loaded on the client (via a LocalScript
) or on the server (via a Script
).
If an Animator
is a descendant of a Humanoid or AnimationController in a Player’s Character
then animations started on that Player’s client will be replicated to the server and other clients.
If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.
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 think this article may a little outdated since it references using Humanoid:LoadAnimation(), which is deprecated, but the animator inside the characters is obviously server-sided because on the client you wait for the animator to be made and then use animator:LoadAnimation(), not Humanoid:LoadAnimation(). The first animations that are loaded in prior to the other characters spawning in are already replicating to the server, it’s just the second wave of animations for the secondary weapon that don’t replicate to other clients. I’m a little confused as to why setting the same exact C0 and C1 for other clients returns a completely different orientation.
Okay, so I think I figured out what the issue was. After switching weapons, I must have not been waiting long enough for the animator to load, because I tried deleting the animator and inserting a new one on the server. This worked, but with just having the client wait for the animator to appear, the issue appeared every time. I added a 2-second delay before having the client load in animations and this fixed the issue. I’m wondering if there is any yield I could add in rather than just a wait() to see when the animator is actually ready for animations to be loaded? I think maybe I have too many Motor6Ds in the rig?
UPDATE: This has not fixed the issue, but has remedied the issue for the client when inserting a new animator. After waiting a few seconds in an actual game, once again it doesn’t work. It works in test servers though. I reduced the amount of Motor6Ds to at most 4 extra Motor6Ds compared to default R6 rig, yet this has not fixed the issue. I’m thinking maybe this may be an engine bug at this point.
This might be something trival but try parenting the instance “Animation” which was created in the script under the Humanoid’s animator right after creation.
I just tried this, still didn’t work. I just isolated the entire script into a different place, commented out everything except for the idle, switching of weapons, and camera functions. This issue was still present there.
Okay, so I decided to make a place where only the animations were involved, and this issue still occurs. Here is everything needed to replicate the issue in the place, just upload the animations and put the new IDs in the script. It works fine in a test server with two players but doesn’t work online. decemus-rig-animation-bug.rbxl (291.2 KB)
This is obviously an engine bug at this point, but I’m unable to post this as an engine bug since post-approval was removed. Any ideas on what could be causing this bug?