Creating Virtual Cameras in realtime

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.

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!

1 Like