Union to Mesh Part?

I’ve heard that performance wise meshes are better than unions. Is this true? If for example I build an arched window, would it be wise to convert that unioned window to a mesh part? Does having the same window as a mesh reduce lag compared to if I kept it as a union? Does it help at all or am I wasting my time? XD

1 Like

Unions tend to perform worse than meshes as they need to be ‘built’ every time the server starts, but this gives them the advantage of having better collisions.
However, if people don’t need to climb your window, it would be better to make it a mesh as they’re just stored data, their collisions are a bit off but it helps reduce part count without causing lag.

4 Likes

Unions do cause lag at times, however it can be advantageous to make unions. It’s certainly not true that a bunch of parts are more efficient or use less memory, but if you ask me i’d go with meshes as unions can get very messy. A perfectly-crafted mesh has the potential to beat everything else imo.

2 Likes

@Irideon @DreamsAltRB_1 So I have this restaurant game, it’s quite big. As such it is also laggy lol, so much so that we’ve enabled streaming to reduce the lag a bit for loading players. Do you think it would be worth it to convert everything in the game to a mesh or would the switch from union to mesh be minimal for such a large map?

Here’s the game if you wanted to look. 🍝 Restaurant I Coastal Cove Eateries - Roblox

2 Likes

I wouldn’t change everything into a mesh, if an item is complex or an item is a complex union and players do not interact with it, make it a mesh.

If a game lags a lot with an average sized map it is likely scripting, not building. Make sure nothing uses loops which run too often or nothing is causing memory leaks. Try to keep scripts to a minimum, one big script can sometimes be much better than a lot of small ones.
Take doors for example, putting them into folders and managing them from a single script really helps A. Keep it tidy and B. Preserve memory.

1 Like

So i just checked out the game, and the first thing that i noticed was how huge the restaurant is, which isn’t bad in itself but one of the things that concerned me were the trees and plant pots you used which are very realistic, and that is without a doubt consuming a lot of memory.

In addition to that, i’ve noticed there are some scripts in your game, which you might wanna optimise if they aren’t already since messed up scripts can usually cause lag aswell.

Another thing i wanted to point out, was how many models were used in both floors of the restaurant including chairs, tables, accessories, floor decoration etc…

Now, if you’ve been copy-pasting the same union multiple times, i think that wouldn’t be an issue, but if you’re using multiple different unions each and every time, then switching to meshes/parts might be a better alternative.

1 Like

True, maybe, but when I was playing around with it and removed the trees to see what lag impact they had, the change was minimal so IDK how big of a impact it has.

Yep! We have a set of about 10 models that we use over and over to fill the dining area up. I’m probably going to re-do the interior as a “V2 Update” so I’ll definitely remember this when I do! I’m probably going to try to add more “filler” models that take up space but have less parts / complexity bc most tables are rarely used heh.

1 Like

That would definitely help a ton, also i forgot to mention this. Make sure to check out this thread it could be really helpful, as it explains everything from terrain and voxels optimisation to textures and materials aswell.

1 Like

If you’ve ever taken even a simple Union and converted it to a Mesh then you’ll see just how many more Faces (or tris) there are that are completely unnecessary.
A more complex Union may have many tris but if you make it a Mesh and clean it up you can reduce the amount of tris there by over 50%.