Trouble with rotation around player object.

I want to have an isolated type of rotation around my character based on mouse x position and mouse y position.

and also be able to do the same type of rotation using the E and Q keys and alternatively Shift-E and Shift-Q for y axis rotation.

Currently the code im using rotates the camera in a stationary position around the y axis(not what i want to do)

or how can i do collision detection and make the camera move past the obstruction?

6958250–819302–InputController.cs (1.07 KB)

This is quite an open ended question and not really a physics problem. I would recommend that you take a look at Cinemachine for your camera. It will take you a bit of time to get used to, but ultimately it makes some of the more complex things trivial (e.g. dealing with occlusion → obstructions).

https://docs.unity3d.com/Packages/com.unity.cinemachine@2.3/manual/CinemachineCollider.html

There are lots of YouTube tutorials, some discuss the integration of the new input system, which may also appeal to you.