Animating many humanoids locally

In my game, I could potentially have MANY humanoids that I need to animate. Only the client can see these humanoids, which is where I run into the issue. How could I go about animating each of these humanoids separately without causing server lag issues? These humanoids could be removed or added at any time.

Does anyone have a better suggestion other than using humanoids and animations?

1 Like

Are the Humanoids being created on the client? If so they won’t be replicated to the server, nor will any animations loaded through them.

4 Likes

I’m not sure the context, but if possible when you have a lot of potential humanoids I suggest converting them to a custom rig and using an AnimationController to animate them. It’s a lot more efficient, Vesteria is a good example of really good implementation.

2 Likes

I’ll elaborate a little: The client will be creating these humanoids. The client will also need to animate them. The problem I’m having is trying to find an efficient way to animate these humanoids individually through the client.

Perhaps don’t animate humanoids which are a certain distance away from the camera?

1 Like

Do you have Filtering Enabled on? if so you should be able to use a localscript through the client AKA StarterPlayerScripts or anywhere inside the Player Object, and just run the animation through there.

EDIT: On the contrary, since the client is creating them and animating them, when animating through the client only that player can see that animation that you posted for it unless you used a remoteevent or remotefunction

1 Like

Every game has filtering enabled now and you cannot disable it, so having the humanoids only run on the client wouldn’t lag the server whatsoever, as mentioned above.

You can disable filtering enabled manually

experimental mode has been discontinued and the property does not affect the game
see: Workspace.FilteringEnabled
image

2 Likes

Wow. I had no clue, thanks for letting me know!

1 Like

Filter is on and I’m currently animating each humanoid through StarterPlayerScripts. The reason I’m posting here is that once enough humanoids are created, the game begins to lag to a point where it’s almost impossible to play. I’m looking for a more efficient way to do this.

Humanoids alone are generally expensive which is probably what’s causing the lag. I think you should make a custom character implementation of sorts, with an AnimationController to facilitate the playing of animations. If you absolutely must use humanoids, try minimizing the intensity of them through methods like disabling physics states they don’t need.

2 Likes

I’m going with AnimationControllers. I made the switch and the lag is basically gone. Eventually I want to make the people walk around, and in that case, I’ll use Humanoids. For now they can just be lifeless blocks.

Thanks for the suggestions, everyone!

2 Likes