I can’t seem to clean up leftovers from my combined mesh. When I try to delete unnecessary meshes and leave only the newly combined mesh it deletes everything. How I should clean up??
Is it possible to generate shapes without actually making game objects? Just raw data for the shapes?
for (int i = 1; i < meshes.Count; i++)
Destroy(meshes[i].gameObject);
I’m not sure if this is a bug or I’m doing something wrong when combining meshes but my code generates planes for each vector and takes the first one to combine with the others making the first one the root of the combined mesh. Previously I was deleting all meshes thus the root one too.
I think this might be a bug because I was not able to create a new separate plane and use it as a target mesh for combine which I think should work??
Shouldn’t this one work? It gives me null reference
@kaarrrllll I noticed that problem was caused in Unity version 2019.4.14f1 and lower. Upgrading to 2019.4.17f1 and also on 2020 works fine. No errors and I’m able to extrude combined mesh successfully.
One question tho. Is it possible to Generate primitive shape without creating the actual object for it?? I just would like to have the data for that object and don’t appear it in the scene at the moment of creation.
Code that I was checking ad was causing errors in 2019.4.14f1 and lower versions of Unity
One way you could do this is by disabling the MeshRenderer as soon as the mesh is created. There isn’t however a way to just build a mesh without also instantiating a GameObject.
One more question @kaarrrllll
Is there an easy way to remove internal adjacet faces? For example Having 3 cubes close to eachother(adjacet) i would like them to not have the internal faces where they connect. So those 3 cubes would form 1 big rectangular shape with empty area inside. So instead having 18 faces i would have 14