RotateAround (418430)

Hi all,

Am I doing something wrong, or does the RotateAround function not work? Trying to get my camera to rotate around the player.

transform.RotateAround (player.InverseTransformPoint(player.position), Vector3.up, 20 * Time.deltaTime);

It rotates extremely widely around some arbitrary point around the “player” object.

Thanks in advance!

I have seen in some examples, people use Lerp functions. Can anyone explain this – the documentation is a bit fuzzy there.

Thanks!

You don’t need to use InverseTransformPosition - the point parameter of RotateAround is in world coordinates. Also, using Time.deltaTime won’t work because this value doesn’t increase. It is actually the time between frames, so it will stay roughly the same but fluctuate according to CPU load. You probably want to use the value of Time.time instead.