How to Optimize Humanoids

This exactly, thanks for writing! Building a custom-humanoid from scratch not only eliminates useful features (properties, events, inbuilt functions, even clothing), but can consume a significant amount of time to develop.

Custom-humanoids can be worth-while and evidently do provide performance benefits, but for the general population of developers optimising the existing humanoid is considerably the best approach.

Tldr and additional tricks

  • Disable all HumanoidStates. These consume memory through constant raycasting.
  • Anchor the HRP and use TweenService to move the character. This reduces the burden on the physics engine. Consider using SteadyOn’s TweenService V2 to do this.
  • Disable collisions. Add all BasePart descendants to a CollisionGroup and set collision to false. No collisions means less physics calculations and greater performance.
  • Set the RenderFidelity to Automatic and CollisionFidelity to Box of all MeshParts within the character. This reduces the polygon count of the character, therefore reduced physics burden.
  • Optimise your clothing. Clothing textures can take up a lot of memory, so make your file sizes as small as possible or remove the clothes entirely.
  • Display and handle the NPCs on the client. This eliminates ‘judders’ caused by latency and reduces the burden of the server.
  • Dumb down your NPCs. Recursive, intensive functions, multiplied by hundreds of NPCs is going to slightly kill your computer. Implement actions as efficiently as you can. ComplierError explains this in greater detail here.
  • Filter out NPCs. If the player is not viewing and interacting with the character, simply parent it out of workspace.

Obviously you may not be able to use all techniques for your situation, so select and use accordingly.

100 Likes