Hi,
I’m trying to instantiate a set number of GameObjects with a rotation of (0, 72, 0). My problem is that all the instantiations of the original are all of the same rotation, when I want them to be 72 degrees apart from each other. How would I do this?
int i = PlayerPrefs.GetInt("Number of Igloo Cameras");
if (n != i)
{
n++;
Quaternion j = Quaternion.Euler(0, 72, 0);
Instantiate(firstSpoutCamera, transform.position, transform.rotation * j);
}
Thanks.
Hellium
2
int instancesCount = PlayerPrefs.GetInt(“Number of Igloo Cameras”);
Quaternion instanceRotation = transform.rotation;
Quaternion deltaRotation = Quaternion.Euler(0, 72, 0) ;
for( int i = 0 ; i < instancesCount ; ++i )
{
instanceRotation = instanceRotation * deltaRotation ;
Instantiate(firstSpoutCamera, transform.position, instanceRotation);
}