In my game I am currently working on there is several planets on which the player can land on (they have gravity that sucks players up too). Once the player has entered the gravity of the planet, I would like the camera angle to equal that of the tangent created by the circle (planet, its 2D), however I cannot get my head around how to do it and I have tried several formulae and other equations with no pervail.

**How would I set the angle (z-axis off the camera) to equal the tangent?**

Here is a quick diagrams to show my predicament (wanting feta angle to make camera’s) and please not that the X axis is opposite to conventional means:

**Thanks in advance, Lachee**

The easiest way is to use Vector3.Cross(). Unity is a 3D environment, so in order to generate the tangent, you need two pieces of information. The first is the vector between the center of the circle and the player (which you outline in your drawing). The second is the vector of the axis of the circle.

If your circle is really a sphere, there are an infinite number of tangents, so you need one other vector that is different than circle/player vector in order to get *the* tangent. Without more description, it is hard to advise you on this second vector.

You want the camera to rotate so that the player on the planet looks like he is standing straight up?

Use the camera transforms LookAt, and use the direction from the planet to the player as the WorldUp parameter.