Splitting a Mesh into Submeshes

I am currently trying to modify meshes in runtime and therefore also updating their colliders at runtime.

Since I am using rather big meshes I was wondering whether it is possible to split an existing mesh (either within Unity or beforehand manually somehow) into multiple submeshes - sorted by “connection” of triangles. This way I could probably achieve a much higher performance since I would not have to modify the “whole” mesh but smaller parts of it.

In Unity 5.6 and older there already was a vertice limit of 65535 which made Unity split the mesh automatically but without paying attention to connected triangles or so and therefore not too useful.

2 Answers

2

I doubt one could split meshes right inside Unity.
You need to use 3D modeling software to do that. For example, here’s how you could do that in Blender (selecting different parts and making them separated meshes is starting from 6:25): - YouTube

Yeah I've worked with Blender before to modify meshes. I just hoped that it might be possible to do so automatically within Unity for different meshes. I will try modifying it within Blender for now and see whether that helps performance-wise. Thanks though, I appreciate your help!

–

You absolutely can split meshes.. You could build a 3D Modeling application with unity. Unity is fully capable of doing practically anything you could imagine. =]

–

Have a look at Sebastian Lagues videos. He teaches mesh handling quite efficiently.

–

Shouldn’t this answer your question?

Thanks, in general this would answer the question regarding the overall creation of submeshes, yes. Splitting the mesh randomly is not that much of a problem, but I am not sure yet on how to split it with regards to the triangles order/position to always have fully connected meshes (e.g. seperating the mesh into 5 submeshes of equal size from left to right with the intersections forming planes inbetween to always have a closed hull).

–

You could raycast a fan of rays couldn't you? Say at 5 or 10 degree increments up to 45 or 90 degrees in front of the player?

–

or as mentioned use a spherecast or collider

–