Hi I was trying to setup a system to procedurally generate 3d rooms on unity.
I used the ProBuilder API to generate a normal cube and that worked fine. But as soon as I want to do any more than that through the API it doesn’t work.
For example if I want to flip the normals of the whole mesh I use this code:
for (int i = 0; i < cube.faces.Count; i++)
{
Debug.Log("Face: " + cube.faces*);*
cube.faces*.Reverse();*
}
If I run the game now the cube stilll looks as before, but if I try to select single faces it behaves like the code worked. Also if I try to do it manually through the manual ProBuilder tool I have to use the function 2 times to make it work.
To me it seems like the code works but somehow it doesn’t get rendered in game afterwards.
Has anybody had the same problem and might be able to help me out?
Cube Generation Function:
void generateBlock(Vector3 size, Vector3 position)
{
cube = ShapeGenerator.GenerateCube(PivotLocation.Center, size);
cube.GetComponent().material = material;
cube.transform.position = position;
}