How do I get camera movement through controller input.

I tried adding the movement to the existing Vector3 but I didn’t want it to keep going. I also didn’t really want to use a bounding box to stop the camera, I think that would be clunky/glitchy. I am trying to get this effect from the camera. Any help is appreciated. I also would like to be able to add the rotation effect, but the main problem I am having is the position. The problem with the position is that with this it literally doesn’t do anything. Any solutions?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraSwitcher : MonoBehaviour
{
    [SerializeField] GameObject CockpitCamera;
    [SerializeField] GameObject ChaseCamera;
    bool CockpitCameraActive = true;
    bool ChaseCameraActive = false;

    Vector3 ChaseCameraPos;

    void Update()
    {
        if(Input.GetKeyDown(KeyCode.C))
        {
            if(CockpitCamera.active)
            {
                CockpitCamera.SetActive(false);
                ChaseCamera.SetActive(true);
            }
            else if (ChaseCamera.active)
            {
                CockpitCamera.SetActive(true);
                ChaseCamera.SetActive(false);
            }
        }

        if (ChaseCamera.active)
        {
            float h = Input.GetAxis("Horizontal");
            ChaseCameraPos = ChaseCamera.transform.position;
            ChaseCameraPos = new Vector3(h, 1.41f, -4.367f);
        }
    }
}

Hi Connor,

You are reading the current chase camera position, but you aren’t assigning back the modified position.