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?
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.
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.
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
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.
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.
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.