As background, I know nothing about cinemachine. I’m using a freelook camer but i’ve emptied out the orginal mouse input for X and Y with a script that can do click + drag camera movement. The input is from the left mouse button.
When I’m playing around with the values in edit mode, everything works fine, but when I run the game, the camera bugs and stays on the bottom rig. All the X axis controls work normally. Sometimes, the camera will snap into the middle and top rigs, but only breifly before it glitches back down to the bottom rig when the left mouse button is held down or clicked at any location.
I put in a Dev Log to see the mouse position and the numbers are correct and go past 0.5, but the camera doesnt agree lmao.
This is the code
using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class DragCamScript : MonoBehaviour
{
public float dragSpeed = 2;
private CinemachineFreeLook cinemachineFreeLook;
public AxisState m_XAxis;
public AxisState m_YAxis;
private void Awake()
{
cinemachineFreeLook = gameObject.GetComponent();
}
void Update()
{
if (Input.GetMouseButton(0))
{
var newPosition = new Vector3();
newPosition.x = Input.GetAxis(“Mouse X”);
newPosition.z = Input.GetAxis(“Mouse Y”);
Debug.Log(newPosition.z);
cinemachineFreeLook.m_XAxis.Value = newPosition.x * dragSpeed * Time.deltaTime;
cinemachineFreeLook.m_YAxis.Value = newPosition.z * dragSpeed * Time.deltaTime;
}
}
}
The code ends here
This is the game and scene view
And here are the settings I have for the rigs
All other settings on cinemachine are the default ones, accept that the camera follows and looks at my player
And my main camera has a brain component which I haven’t touched.
I don’t understand anything, so if theres any other feilds that anyone needs for more info pls comment.

