Scripting for camera depth

Is there a way that I could change the depth of a camera by clicking on a button using scripting? As in, when I click a button, a camera view appears of my whole scene from above, showing where the player is relative to his surroundings. By appears, I either mean come to the front (change depth to a greater number), or literally appear (because it was invisible before). Please help.


Your question was a bit cryptic with how much you jumped around, but I assume you want to change the draw order of your camera to make it the visible camera. For this you can use the Camera.depth property, this is accesible from script.

I would recommend against this. If you are only wanting to view these cameras at certain points in your application you would be better off enabling them in these situations and keeping them disabled when you are not using them. Changing the draw order does not stop them for rendering, they are just overdrawn by other cameras.

I would have one camera that is disabled (there is a check box next to the name, uncheck that) and then re-enabling it using ` = true`.