Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Changing Cinemachine Brain properties at runtime

Discussion in 'Cinemachine' started by oludev97, Nov 3, 2022.

  1. oludev97

    oludev97

    Joined:
    Apr 8, 2019
    Posts:
    3
    I need to alternate between update methods because Cinemachine jitters when my player object is parented to a moving object, I'm sure there is incompatibility issues with my movement system which causes the jitter but Ive come to far to refactor my movement system to accommodate this requirement.

    I've figured out how to create a new update method at runtime but I cant figure out how to apply the update method to my current Cinemachine brain.

    Code (CSharp):
    1. if (other.gameObject.tag == "Player")
    2.         {
    3.             CinemachineBrain.UpdateMethod method =     CinemachineBrain.UpdateMethod.FixedUpdate;
    4. //How do I set this new update method to my CinemachineExtension brain at runtime.
    5. }
    6.  
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    CinemachneCore.Instance.GetActiveBrain(0).m_UpdateMethod = bla
     
    oludev97 likes this.
  3. oludev97

    oludev97

    Joined:
    Apr 8, 2019
    Posts:
    3
    thank you :cool: