Search Unity

Render to viewport

Discussion in 'Scripting' started by mjjw, Jun 24, 2006.

  1. mjjw

    mjjw

    Joined:
    Nov 12, 2005
    Posts:
    59
    Is it possible to set up two cameras and get one of them to render to a viewport on the other?

    I am making a web game with a GUI border which encases the game action, however the game action is offset to one side. This has the effect that I can see too much of the left-hand-side of all the objects so it doesn't look like the camera is 'hovering' directly above the action.

    Hope that explains what I'm trying to get at.

    M
     
  2. Morgan

    Morgan

    Joined:
    May 21, 2006
    Posts:
    1,223
    Yes--I think you would want one camera that shows no objects but is full-screen to hold the GUI.

    Then, layered in front of that would be your "main camera" with a smaller viewport positioned a bit to the side. It could have some HUD elements too if you needed them.

    That way, the main camera doesn't have a big area on the side being covered up. It just shows what you want to show.
     
  3. mjjw

    mjjw

    Joined:
    Nov 12, 2005
    Posts:
    59
    [EDIT] I sorted out my problem now. Thanks for the advice Morgan!