I am creating a mesh that is a cube with two vertices of the same edge removed. This makes it a prism. The problem is that after clearing the mesh then setting the new vertices and triangles, only half of the triangles appear at the same time. The other half appear when changing the scene camera’s angle. Here are some screenshots to show the problem :

As you can see the triangle to the right does not appear in the first screenshot but appears through a missing triangle in the second screenshot. Here is my code :

```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class createPrism : MonoBehaviour {
public Mesh mesh;
void Start () {
mesh = GetComponent<MeshFilter>().mesh;
Vector3[] vertices = {
new Vector3(-0.5f,-0.5f,-0.5f),
new Vector3(0.5f,-0.5f,-0.5f),
new Vector3(-0.5f,0.5f,-0.5f),
new Vector3(0.5f,0.5f,-0.5f),
new Vector3(-0.5f,-0.5f,0.5f),
new Vector3(0.5f,-0.5f,0.5f)
};
int[] triangles = {
0,1,2,
1,2,3,
0,1,4,
1,4,5,
2,3,4,
3,4,5,
1,5,3,
0,2,4
};
mesh.Clear();
mesh.vertices = vertices;
mesh.triangles = triangles;
mesh.RecalculateNormals();
mesh.RecalculateBounds();
}
}
```

This is probably an easy fix but I couldn’t find anything like this online.