Should I use meshparts instead of a bunch of parts?

Hey! I’m building some stuff and I noticed that my game has around 5.8k parts and it’s very laggy. I saw some people say that meshparts than unions. Would converting all of these parts into 200 meshparts reduce the lag?

1 Like

What you’re building? It’s important to know because meshparts hitbox isn’t perfect. Stuff like terrain won’t work well with meshparts.

You also need to consider caching and limits. Now meshparts are extremely good for A LOT of things but generally you need to decide what’s easier and better to use. Now using meshparts over unions should ALWAYS be done. If your game has 5.8K normal parts and it’s lagging it definitely isn’t the parts, and will not it wouldn’t fix your problem. Also, Krunnie is right about the hitbox issue with meshparts, and I can personally vouch for using 10k+ parts in a map on low end mobile devices without any noticeable lag.

May I ask what your specs are? As this could determine your lag issue if you have an extremely low end computer/device.

5.8k parts is not that much. The maps we have in our game are above that each, yet players are able to play the game even on lower end devices like an iPad. This makes me think there is more going on.

No, for the most part. Parts are significantly faster to render due to their simple and consistent shapes. Only if you have models that contain many parts and have been reused a lot throughout the map, does it become better to replace them with meshes because then you can take advantage of the automatic level-of-detail system and the lower memory usage due to the same mesh being reused.

I’m going to assume that by this you mean “Should I use meshes instead of unions?” which makes me think that you might have unioned together a lot of parts, in which case your performance would indeed tank a lot. Unions are not optimal shapes, meaning they often have unnecessary faces/tris in their geometry, increasing rendering time. Their geometry will have to be (down)loaded from the server, which is something that isn’t needed with regular parts since, again, their shapes are consistent and can thus be rendered using only a few properties. If you have many unique unions, you would need to download the shape of each and every one and given that they are all different, they cannot be grouped and drawn in only one call, which again increases rendering time.

If this isn’t the case however, then there might be some other factors that play a role in the performance, such as many overlapping transparent parts, textures that are way too big (e.g. 800x800 pixels), an abundance of visual effects like particles or beams, or maybe even a combination of all of this.

But really we need more info to actually help you out. Especially pictures, videos or a link to your game can help.

2 Likes

In my personal experience, meshparts should be utilized for the high detail objects of your scene that would take too many parts otherwise to replicate: guns would be an example of this. If it’s buildable without meshparts in a reasonable part count then just use parts.

1 Like

I would suggest reading this article by @Mariofly5. It gives some helpful insight on when to use meshes, unions, and/or parts.

1 Like

He’s got a point.I usually have a ton of bricks in my games, yet it still runs pretty decently.

It all depends on preference. Each solution has their own flaws. I suggest you try them both, and see which suits you best.