My searching so far has not turned up exactly what I’m looking for:
I would like to have a subwindow in the application that displays a custom/dynamic 2D scene. Effectively, this would be like drawing a 2D/overhead map.
It is not simply an overhead view of the main scene. Basically, I’m taking data collected by a character in the main scene, and using that data to construct the map as the character moves around. Basically, I would be calling a bunch of “draw points” in the subwindow.
I’m sure there is documentation or threads on how to do this, but I haven’t found it so far. Can anyone here point me in the right direction?
Set the ViewPort rects of each camera to cover the portion of the screen you want them to cover (these values are normalized to [0-1], with 1 being the entire screen)
Set the priorities of each camera to decide which one draws On Top of the other.
Set the culling masks of each camera to include/exclude layers that you want each camera to draw.
Hi PB,
I don’t think I’ll accomplish what I want to do with a second camera on the same scene. It seems like one option would be to have a second scene, and have this run in parallel to the first scene. It would be viewed in a viewport/subwindow of the first scene. And it would also need to share data with the first scene…the content would be based on what is happening with the first/main scene, but it is a different visualization.
The other option, I think, is to dynamically create an image each at each update period, and display that as a UI element overlaying the first/main scene.
Unity can load multiple scenes additively. But they will both loaded into the same “game world”. You can completely separate them from interacting with one another through the use of layers (both for physics and rendering) and/or physical separation. But I don’t know of any way to “run two scenes in parallel”. Unity is fundamentally single-threaded.
Thanks again. So, how I might do this. In scene 1, a sensor will do a raycast and detect a collision at a point. Scene 2 can be 2D. Centered at the sensor origin. And could use the data gathered in scene 1 to draw just the collision point. Does this sound reasonable?