Making an object cirlce around a certain point

Hi,

I’m messing around abit in Unity and now I would like to make a sun that circles around my gameworld. The problem is I’m kinda lost on how to do it, and could’t find any tutorial on it either. So I’m asking for your help. I’m thinking about setting and invisible point on the map, put a set distance between the sun and this point and then put some speed on it to make it circle?

When I say I need help to do it, I mean with the code, C#. Not the whole thing, just some guidelines. :smile:

Thanks!

Just make the sun a child of a pivot object, and rotate the pivot. (transform.Rotate)

Is that it? Will it always rotate then? :open_mouth:

You could also use the transform.RotateAround() function:

var degrees = 10;
var sun : Transform;

function Update() {

    transform.RotateAround(sun.position, Vector3.up, degrees * Time.deltaTime);

}