Rotating Camera around a game object

Hello,

I’m trying to get my camera to rotate around a game object that is placed in the center of a cube. It is supposed to mimic that the cube is rotating when I touch and drag on the screen. I want the camera to look at the game objects axis and when i touch the screen is rotates around the game objects center point. I have a script for the rotation working I just need to the camera to follow the game objects rotation around the cube.

suggestions on references or what to look at would be greatly appreciated.

There used to be a MouseOrbit script which doesn’t pretty much want you want, check out this older post that posted the code:

edit:
Just updated that post to make the code readable again.