Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

why canvas' render camera cannot store in prefab in 'screen space - camera' render mode

Discussion in 'UGUI & TextMesh Pro' started by xophiix, Dec 9, 2014.

  1. xophiix

    xophiix

    Joined:
    Dec 9, 2014
    Posts:
    3
    when I assign my cloned canvas' 'render camera' and apply to prefab, prefab's render camera remain None.
    And even more, the property cannot be set in script cos it's invisible, and the only similar property 'camera' is readonly. I want to know why.
     
  2. Sbizz

    Sbizz

    Joined:
    Oct 2, 2014
    Posts:
    250
    If you want to set an GameObject on a prefab, it must be a prefab as well. Just save your camera as a prefab and it should be OK.
     
    ImShinx and xophiix like this.
  3. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    628
    Try setting Canvas.worldCamera - seems to work for me (I'm additively loading UI scenes, so it takes a bit of messing around to avoid duplicate UI cameras)