Make camera perpetually rotate around a target.

Hey, I’m trying to make my game camera constantly and perpetually rotate around a target object in the center of the screen, and I want the camera to do this on its own, independent of any action on the part of the player.

Currently I’ve got the camera set up using the standard MouseOrbit script, but I want the camera to move on its own, and not based on commands from the mouse.

To make the camera rotate around an object, have a look at transform.RotateAround.

It would be something like this:

var target : Transform;

function Update()
{
    transform.RotateAround (target.position, Vector3.up, 20 * Time.deltaTime);
}

Ah, thanks a bunch! :slight_smile: