Rotate around fixed point

hi there

i´ve a problem…

Situation:
I´m working on a Dungeon Keeper mechanic remake. Yesterday i started with the basic mouse and keyboard control.
Now i stuck in a Problem.

As first, want to use a gameobject as central point. The camera always should look at this object, with a Tilt of -50° (looking
diagonally down on the object).
And as a second… the camera should ALWAYS look at this object. Even if i rotate or zoom it.

Can someone give me a hint/help me out how to do those two things?

First of all I wish you good luck, being a fan of Dungeon Keeper I hope you will suceed at what your are doing :slight_smile:

Then for your problem. I can’t give you a precise answer. But my guess would be going with the LookAt function (Unity - Scripting API: Transform.LookAt) in the update of your camera’s script.

Then, for circling around the object, I think using some math would do the trick. Get the value of the horizontal axis, and apply some formula to move your camera along a circle.

Sorry if I’m not very precise, but theses are some hint you could look into. I don’t guarantee anything though ^^

Thanks :slight_smile:
I don´t want complete scripts… since i wanna learn unity :wink:

I figured out this way:
Adding an empty adjustor object in the hierarchy, make it the parent of the camera, place the camera, so the adjustor is centered in the gamescreen, and simply rotate the adjustor or change fieldOfView.

:slight_smile:
It´s working like a charm - don´t know why I did not come out…

There is a unity script for this called mouseOrbit.