Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Switching between body types in runtime from code

Discussion in 'Cinemachine' started by elitemantis, Oct 21, 2020.

  1. elitemantis

    elitemantis

    Joined:
    Nov 14, 2012
    Posts:
    7
    Hello, I have a quick question.

    If I create in code GameObject with CinmeachineVirtualCamera component, how can I via script define what Body type I want to use (I want to be able to pick between DoNothing/Transposer/Tracked Dolly)? I would also like to possibly modify this type later on if that is possible.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
  3. elitemantis

    elitemantis

    Joined:
    Nov 14, 2012
    Posts:
    7
    Thanks! I thought that there was some less roundabout way to do it, that was my first solution GetCinemachineComponent to check what kind of camera it is, Remove and Add if necessary.