Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How do i change tracked dolly path from virtual camera via code

Discussion in 'Virtual Production' started by Ronanator, Dec 31, 2021.

  1. Ronanator

    Ronanator

    Joined:
    Jan 30, 2017
    Posts:
    1
    So im trying to just lean how to change dolly path with a list of paths that are created.

    ive also added a image that shows my cm vcam

    Thanks for the help

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Cinemachine;
    5.  
    6. public class PathChange : MonoBehaviour
    7. {
    8.     [SerializeField] CinemachineTrackedDolly tmpDolly;
    9.     [SerializeField] List<CinemachineSmoothPath> pathes;
    10.  
    11.     public void ChangeDolly(int i)
    12.     {
    13.         tmpDolly.m_Path = pathes[i];
    14.     }
    15.  
    16.     // Start is called before the first frame update
    17.     void Start()
    18.     {
    19.         ChangeDolly(1);
    20.     }
    21.  
    22.    
    23. }
     

    Attached Files: