Search Unity

What is the best way to manage different camera systems in game?

Discussion in 'Cinemachine' started by Mozq8, Nov 6, 2020.

  1. Mozq8

    Mozq8

    Joined:
    Dec 30, 2016
    Posts:
    61
    Hey there, so I want to create procedurally generated camera systems for the event, like sports game event.
    What is the best way to implement it in terms of the camera manager, so here are the questions:

    1) How to trigger different camera systems like Blend List, Clear Shot, Mixing Camera - do I need to make an event system for that, or I could just activate/deactivate them as a game objects (simple Set Active True/False)?
    2) If we are talking about activating them as a game object, what about the previous camera system like Blend List, do I need to deactivate it?
    3) My target is High-End PC - how many Virtual cameras can I have in one scene in terms of optimization?
    4) For instance, I want to create the Parent which randomly picks children Blend List will that work?
     
    Last edited: Nov 6, 2020
  2. Mozq8

    Mozq8

    Joined:
    Dec 30, 2016
    Posts:
    61
    Anyone, guys? There is not much info about how to set up Cinemachine manager more efficiently
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Sorry for the delay - it's coming up to release time for us, and we're very busy. A few basics:

    - CM Manager vcams (like BlendList, ClearShot, Mixin, etc) exclusively manage their vcam children, but look to the outside world like simple vcams, and can be treated as such. You can nest them too, by the way.

    - The CM Brain will take the highest-piority active vcam (or manager) as the Active Camera. If multiple vcmas share the same highest priority, the the most-recently-activated one will win.

    - You can make a vcam (or manager, same thing) become current by simply activating it (if no other active vcam has a higher priority), or by boosting an already-active one to a higher priority. A vcam can also become active when it becomes the best candidate because another higher-priority vcam gets deactivated. It's up to you to decide how you want to manage this.

    - For best performance, we recommend activating vcam GameObjects when you want them to take control, and deactivating the outgoing ones. You can do that on the same frame, CM will keep the outgoing ones on artificial life-support until the blend is finished.

    - You can certainly create a system that randomly chooses BlendList children. Activate the new one, deactivate the old one (you don't have to do that, but it's best practice not to waste CPU cycles).

    - You can have quite a few (dozens) of active vcams in your scene. CM round-robins the updates by default. However, there is no need for this unless you have something like ClearShot, where the vcam children are monitoring shot quality and need to stay active. Don't blow your CPU cycles for nothing.