Hey folks,
So I’ve taken a look around at a lot of the unity answers regarding this issue, but I can’t seem to get my head round it.
I’ve got a directional light in the center of my scene (my sun) and I’m attempting to have it Rotate 360 degrees on the x axis, while also rising and falling in the sky on the y axis. However, part the way through the rotation I’m losing control of the rotate. Perhaps someone could enlighten me?
This is the 24 hour rotation I am attempting to mimic: http://www.gdargaud.net/Antarctica/DC2005/Pano/SunRun_.jpg
if (SunUp == true)
{
sun.transform.RotateAround(sun.position, Vector3.right, 10 * Time.deltaTime);
sun.transform.RotateAround(sun.position, Vector3.up, 10 * Time.deltaTime);
}
if (SunUp == false)
{
sun.transform.RotateAround(sun.position, Vector3.left, 10 * Time.deltaTime);
sun.transform.RotateAround(sun.position, Vector3.up, 10 * Time.deltaTime);
}