Search Unity

Virtual camera for render texture without being priority camera?

Discussion in 'Cinemachine' started by TheCelt, Sep 1, 2019.

  1. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Hi is there a way to have a virtual camera used for render textures but not being the main camera for the game?

    So i have this setup:
    1 cine-machine brain
    2 virtual cameras¬
    1 V cam follows player
    1 V cam follows enemy

    I want the enemy V cam to render to render texture even though the player V cam has the priority.

    How do i set this up correctly to work ?

    Thanks
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I happen to have been playing with an almost identical setup myself earlier today.

    Gregory gave a good response to this here.
     
    Last edited: Sep 3, 2019
  3. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Tried this but it doesn't work for me.

    This is my setup:

    Brain A:
    upload_2019-9-1_5-27-30.png

    Brain B:
    upload_2019-9-1_5-28-2.png

    VCam A:

    upload_2019-9-1_5-29-9.png

    VCam B:

    upload_2019-9-1_5-29-34.png


    Both VCams have priority 1, yet both brains show no active camera. Both Vcams have Status : Standby.

    Heres an even weirder thing, if i set Vcam A priority to 26 or higher only then does VCam A become live status. I'm not aiming to do split screen like the other thread - only send the Vcam B to render texture.

    I am not sure why i need to set priority to 26 for A when B has priority 1 - plus they should not be competing anyway. It feels like it might be a bug?
     
  4. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Edit - i've solved it. Seems i had another camera i was using for testing and forgot to remove it. :)
     
  5. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Awesome. Glad it's sorted!