Search Unity

Multiple Camera and Ray problems

Discussion in 'Scripting' started by Connor_13_, Jul 30, 2014.

  1. Connor_13_

    Connor_13_

    Joined:
    Mar 14, 2014
    Posts:
    40
    I am working on a game in which I have two cameras, one of which is disabled. Can camera.ScreenPointToRay(...) still function on the camera that is disabled or does it need to be enabled? What if the camera position / rotation changes while it is disabled?

    If it needs to be enabled for it to work, how can I have two cameras enabled simultaneously but have only one "in focus" where a picture is being shown to the client?

    Thanks
     
  2. hammil

    hammil

    Joined:
    Jun 5, 2013
    Posts:
    56
    The 'main' camera is controlled by a tag - the 'MainCamera' tag specifically. If more than one camera is enabled (and not rendering to a texture), the one tagged 'MainCamera' will be used. So simply switch out the tags.