Search Unity

How to create a vitrual cam with framing transposing and pov via script?

Discussion in 'Cinemachine' started by lumim, Mar 2, 2019.

  1. lumim

    lumim

    Joined:
    May 31, 2017
    Posts:
    2
    Sorry for my ignorance, I have been trying for a long time to set up the virtual camera for framing transpose and pov via script but I can not find the correct properties, I could not find anything about it either, so if anyone knows help me please.

    I simply want to instantiate a virtual camera with body properties set to framing transpose and aim to pov via script.
    Code (CSharp):
    1. vcam = new GameObject("VirtualCamera").AddComponent<CinemachineVirtualCamera>();
    2. vcam.m_Follow = transform;
    3. vcam.m_LookAt = transform;
    4.  
    5. //Set body to framing transpose and aim to POV.
    6.  
    7. vcam.m_Priority = 10;
    I want to go from this:

    to that:

    via C# Script
     
    Last edited: Mar 3, 2019
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Use vcam.AddCinemachineComponent<CinemacheneFramingTransposer>() etc.
     
    lumim likes this.
  3. lumim

    lumim

    Joined:
    May 31, 2017
    Posts:
    2
    Thank you very much :D