A.k.
0
Q:

how to access tracked object offset value in cinemachine

GameObject camObj; //This is your camera with the free look component on it

CinemachineFreeLook freeLook; // this reference the free look component in your camera

//I named this variable comp for "Composer", you can name it however you like. This is the cinemachine component with all the aiming stuff on it
CinemachineComposer comp; 

void Start()
{
	camObj = GameObject.FindWithTag("MainCamera");

	freeLook = camObj.GetComponent<CinemachineFreeLook>();

    comp = freeLook.GetRig(1).GetCinemachineComponent<CinemachineComposer>();
	
    // This is how you get to "Tracked Object Offset" of the rig as well as any other property in the rigs.
    comp.m_TrackedObjectOffset.y = "your value here";
0

New to Communities?

Join the community