Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. void Start() {
  2. Mesh mesh = GetComponent<MeshFilter>().mesh;
  3. Vector3[] vertices = mesh.vertices;
  4.  
  5. int o = mesh.triangles[0];
  6. int t = mesh.triangles[1];
  7. int h = mesh.triangles[2];
  8.  
  9. vertices[o] += Vector3.up * 2;
  10. vertices[t] += Vector3.up * 2;
  11. vertices[h] += Vector3.up * 2;
  12.  
  13. mesh.vertices = vertices;
  14. mesh.RecalculateBounds();
  15. mesh.RecalculateNormals();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement