Flip a mesh inside-out?

Basically, I need to have a inside-out cube to use for a cloud skybox overlay. So as we al know, triangles are only rendered on one side. So I thought I could simply flip the tris over, but it didn’t seem to work. Here is my script:

`
using UnityEngine;

using System.Collections;

public class FlipInsideOut: MonoBehaviour {

public int[] Tris = new int[100];

int temp;



void Start () {

	Tris = this.GetComponent().mesh.triangles;

	for(int i = 0; i < 100; i++){
		if(Tris[3*i] != null){
			temp = Tris[3*i+1];
			Tris[3*i+1] = Tris[3*i+2];
			Tris[3*i+2] = temp;
		}
	}
	
	this.GetComponent().mesh.triangles = Tris;
	
}

}
`

Does anybody have any idea why it isnt working? I shouldn’t see the mesh from the outside.
If anybody could help me I’d be very happy.

Your method should work fine. This is easier:

using System.Linq;

Mesh mesh = GetComponent<MeshFilter>().mesh;
mesh.triangles = mesh.triangles.Reverse().ToArray();

There are two ways to render the inside of a cube.

  1. Use the Flip Normals in the modeling application of your choice. (Not sure if the function is universally flip normals) This makes the visible side of the mesh only visible from within the cube
  2. Use a shader that renders both sides of the mesh(exe Toon Shaders and the Particle Shaders)