Search Unity

Creating Virtual Cameras in realtime

Discussion in 'Cinemachine' started by aer0ace, Nov 6, 2019.

  1. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I would like to create VirtualCameras in code, while the game is running.
    I tried doing this, but when I set the LookAt and Follow, the VirtualCamera didn't seem to move.
    I have a CinemachineBrain attached to a UnityCamera, and the GameObject has a layer. I have set that layer on the VirtualCamera as well. I'm not sure if there is some sort of update, refresh, or some other thing I have to do to get CinemachineBrain to do its thing.
     
  2. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    Okay, I found the solution to this. I was missing the Cinemachine Components for Body and Aim. I added a CinemachineTransposer and CinemachineComposer, and it was working great!
     
    Gregoryl likes this.