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.
