How can I mimic this game's camera in Unity?

Hello there,

I’m trying to mimic the camera functionality of the Knights of the Old Republic game in Unity. link:This is a link to a video for a more visual demonstration for those interested.

Essentially, what it boils down to is this:

  1. It’s a 3rd-person camera that collides with walls. (Easy enough to do with Cinemachine)
  2. The cursor is visible and confined to the game screen. It’s usually free to interact with various HUD/UI elements.
  3. If I move the cursor to the edge of the screen, it rotates the camera along the X axis. I can also rotate the camera by holding down right-click. (Note: holding down right-click will also allow the camera to be rotated along the Y axis, but there’s generally nothing to look at in either direction there, so it’s not important.)
  4. The player will move relative to the camera (e.g. the way the camera is facing is forward), but I’m fairly certain I’ve got that bit figured out.

Is this achievable with Cinemachine or would it be better to make a custom camera script?

For those interested, I think I have found a solution.

// Before any class declarations, add 'using Cinemachine;'

void Start()
   {
	   CinemachineCore.GetInputAxis = GetAxisCustom;
   }

public float GetAxisCustom(string axisName)
	{
        if(axisName == "Mouse X")
		{
            if (Input.GetKey("mouse 1"))
			{
                return UnityEngine.Input.GetAxis("Mouse X");
            } 
			else
			{
                return 0;
            }
        }
        else if (axisName == "Mouse Y")
		{
            if (Input.GetKey("mouse 1"))
			{
                return UnityEngine.Input.GetAxis("Mouse Y");
            } else
			{
                return 0;
            }
        }
        return UnityEngine.Input.GetAxis(axisName);
    }