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

Changing Virtual Camera 'Body" attributes through script

Discussion in 'Cinemachine' started by LofiSenpaiii, Jan 7, 2022.

  1. LofiSenpaiii

    LofiSenpaiii

    Joined:
    Nov 14, 2021
    Posts:
    4
    Hello, I cannot figure out for the life of me how to reference to change attributes of the virtual camera (IE Camera distance or Camera side) in c#. Any help would be appreciated.
     
    DanonePlayer likes this.
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Code (CSharp):
    1. CinemachineComponentBase body = vcam.GetCinemachineComponent(CinemachineCore.Stage.Body);
    or
    Code (CSharp):
    1. var thirdPersonFollow = vcam.GetCinemachineComponent<Cinemachine3rdPersonFollow>();
     
  3. LofiSenpaiii

    LofiSenpaiii

    Joined:
    Nov 14, 2021
    Posts:
    4
    Thank you so much!