"GetPlayingAnimationTracks" when run from client, returns the name of the animation, while when run by server it does not? What can be done instead?

How does it come that “GetPlayingAnimationTracks” when run from client, returns the name of the animation, while when run by server it does not?

GetPlayingAnimationTracks() returns animations along with the name of the animations if ran by client, but if this gets ran by the server, it does not return the name of the animations and instead just gets called “Animation”.

 
An example, you could go in Studio, spawn in and type this in the Client console.

game:GetService("Players").LocalPlayer.Character.Humanoid.Animator:GetPlayingAnimationTracks()

 
This will then print a table, as example, if you would be standing still it would print:

{
	[1] = Animation1
}

 
However, if you would be running the command in the Server console, just make sure to change LocalPlayer to your player name.

It would return this

{
	[1] = Animation
}

 
 

What I am wondering is, how does it come that if the function is ran by the client, it does return it with the animation names but when ran by server, it does return animations just without the name? And how can the server get the name of the animations?

Because the animations are ran on the client and not on the server

Not sure if the “Server window” on Studio, means anything, but if I would be running /e dance and switch to the “Server window”, the animation gets played on there as well just not that well like it does it on the Client, but the animation plays.

But for this function I asked about, it doesn’t return the names if ran by the server, and I am wondering how I can get the names then in a good way.

Character movement gets replicated but the server doesn’t know its an animation so they don’t store it as one.

But when I run the function on the server, it returns even the AnimationId, the only thing that I see missing is the name.

So I am not really understanding, what you would mean with, that the server doesn’t store it as one.

1 Like

Animation instance names do not replicate between the client-server boundary. This means that the server sees it as a blank Animation.

So, what I am trying is to change the player animation, like “run” and “walk”, but this time instead of changing the animations inside the LocalScript “Animate”, I want to try to retrieve the animations instead. That means it would work on places that use a custom animation system. If I test that what I am trying to do on the client side in Studio, it works fine.

And I am wondering how I should do that now.

Do I have to do it with a RemoteEvent and Fire to all Clients now?

Can the server force the client to fire a client side thing on their side?

I was wondering the exact same thing as you, have you found a solution to the problem yet?

2 Likes