I’m trying to rotate one sphere around another sphere, like a planet around a sun. No matter what I do tho, the planet object only rotates around it’s axis and doesn’t move. This is the code I’m using:
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
}
}
I’ve tried to set the first Vector3 to the transform.position of my Sun object, but no matter what I do, it just sits in one place and rotates on its own axis but never actually moves. Doesn’t matter what I put in there, it seems.
What am I doing wrong?