how to make a half cube?

help, I would like a standard prefabcube cut at 45° through the middle, keeping only half the triangles and adding 2 triangles to the long side.

There isn’ t one in the asset store and on the forum, any chance someone can edit the standard create cube mesh to delete 2 vertices, 6 triangles, and to add 2 new triangles? With all the standard UV mapping etc because I can’ t even find a working code to create the cube from script.

Pseudocodingly speaking, it would be something like this:

vector1 = (0,0,0)

vector2 = (1,0,0)

vector3 = (0,1,0)

vector4 = (1,1,0)

vector5 = (0,0,1)

vector6 = (1,0,1)

then triangle index:

0,1,2

2,3,0

0,4,3

2,1,5

0,4,5

5,1,0

4,5,2

2,3,4

Mesh myMesh = new Mesh();

myMeshFilter = (MeshFilter);

gameObject.GetComponent("MeshFilter");

myMeshFilter.mesh = myMesh;

myMesh.vertices = vertices;

myMesh.triangles = triangles;

The UV mapping depends on what texture you want to use, but anyway I recomend you that you study some geometry. Anyone should be able to do at least these four things: plan a tree, write a book, have a child, write a sliced cube mesh code.

It’d be far more instructive for you to create your own model. Do this in the OBJ model format, see:

This is a simple text file. You’ll have 6 lines that start with the letter ‘v’, which define the 6 corners, and 8 lines that start with ‘f’ and define the triangles. Try that. Then, your stretch goal is to add texture coordinates and normals.

this a simple way: How to Cut Cube to Make Stack Game in Unity - YouTube