#How do you combine meshes

1 messages · Page 1 of 1 (latest)

south sentinel
#

Hello everyone, and thank you in advance.

I want to make a system that instantiates a cube, and then takes the mesh of that cube, and adds it to one big mesh.
I want to do this to improve performance, but I don't know how to add all the meshes together.

chrome matrix
#

Wait... there's a CombineMeshes function in Unity? How effective is that?

#

but that looks like it will only get the mesh for that 1 gameObject, you need to loop through the entire hierarchy.

#

Try using GetComponentsInChildren node, and provide it that instantiated GameObject's transform... until someone comes along with a better way to do it at least

south sentinel
# chrome matrix Wait... there's a CombineMeshes function in Unity? How effective is that?

Apparently it's very very effective, this guy triples his FPS just by combining meshes https://www.youtube.com/watch?v=5WbmDZohtJY

And thank you very much for your answer, I'll try that and let you know how it goes

In this video I will show you a simple Unity3D (C#) code which combines meshes to greatly improve your fps.
Wishlist my new game, HexLands now! ➤ https://store.steampowered.com/app/2244650/HexLands/?utm_source=yt&utm_content=mesh-comb
Join our Discord community ➤ https://discord.gg/6hKwSaCkwa
This way your framerate / fps will greatly improv...

▶ Play video
south sentinel
chrome matrix
#

I think for true recursive component fetching in a hierachy the best approach is to build the steps yourself.

Even in C# GetComponentsInChildren has some unfortunate quirks, and it is a tad worse in UVS.

You can definitely do this in UVS but a bit tricky if you're just getting started

south sentinel
low flume
#

as a side node, I've found Claude quite strong at understanding visual scripting compared to some other models.

It has produced some custom nodes or units, and supplemental scripts for some missing UVS functions (such as interacting with post processing, or modifying the environment colors in URP)