Question by
Mobilpadde · Nov 13, 2015 at 02:00 PM ·
vector3verticesalgorithm
Connect gameobject to previous gameobject after rotating
I've made an algorithm to generate triangles and connect each to the previous triangles, now, though, I'm trying to add some rotation to each triangle, but by doing so each triangle isn't touching the previous triangle.
So my question is, how do I keep the triangles connected even though I rotate them? So far I've added a pivot in the middle of the left side of each triangle (They're connected to each other on the right side), and rotating the pivot (Or parent of the triangle) using this equation:
pivot.transform.Rotate(Vector3.up, (i + 1) * 360f / triangles);
But by only using this, the triangles don't get a new position, so they just rotate around their pivot.
Ps. I'd probably add, that I'm trying to make a circle of triangles.
Comment