So I have a storage for viewports in workspace
, and it holds around 80 characters in one position, and its lagging my game out. The reason I can’t put it inside ReplicatedStorage
is because they have to be animated. They have humanoids. They are all canCollide
off, and have their humanoidRootPart
s anchored. How would I stop this from lagging my game?
Two thoughts:
-
Clone all of them at once to the client when the player joins. Animate them locally.
-
Clone them as needed from ReplicatedStorage. Animate them on the Server. Then delete them.
Are you loading them into the Viewport as needed or do you have 80 viewports loaded with characters?
I just load them as needed.
Also are the thoughts steps or options I can take?
Does it run locally or does it run on the server side?
theyre all on the serverside, and get cloned into the client.
If you are cloning them to the client why not keep them in ReplicatedStorage?
I probably should, but I just added them into workspace to animate them before they get added.
A: Im not sure but it could be because all of the characters are in one position?
B: Run the animations in the animator inside humanoid
C: Load the animations only when the player sees the viewportframes
I am pretty sure its physics lag, I checked the microprofiler, but I’ll take those into consideration.