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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Multi cameras with multi canvas

Discussion in 'Editor & General Support' started by Dzxyan, Mar 13, 2018.

  1. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    Hi all,
    I have a scene with two cameras and two canvas,
    one for landscape and one for portrait,
    both using different game object,
    I'm use switch camera with setActive,
    display is working fine, but all game onject in second camera are cannot touch with mouse,
    any one can help me?
     

    Attached Files:

  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    How are you disabling the canvas you don't intend to use? I'm asking because if you're doing something like just setting alpha to 0 it can still be on top of the other canvas you're trying to use.
     
  3. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    Hi, i'm attach landscape canvas to landscape camera and so do to portrait canvas to portrait camera, using camera[0].setActive(true) and camera[1].setActive(false) to control it.