Forcing a camera to be rendered when it's stubborn?

I’m dynamically creating cameras in my game, and I’m using Depth Only to stack imagery. However, I can’t figure out how to “wake the new cameras up”. In the Editor, I have to go into the field for any property of the camera, as if to edit it, although I don’t actually need to edit anything, and then it renders. Otherwise, it isn’t rendering. I have no idea what to do to get it to show up on the iPhone - same result without any ability to Edit anything, obviously. Any tips?

Bump. I don’t have an answer for ya man but thought I’d float this back to the top for (hopefully) extra eyeballs.

Tom, thanks a lot. I reported this bug:

The scripts that I use in this project consist of the line

(gameObject.AddComponent( typeof(Camera) ) as Camera).depth = 0;

When it’s in Start(), it works, but it breaks in OnBecameVisible(). Unfortunately, that’s where I need it. I’m going to experiment, trying to find a workaround. Again, if anyone has some advice, I’m all ears.

219244–7977–$onbecamevisible_depth_problem_163.zip (576 KB)

I discovered that this is even more of a general problem than I thought. If you modify any camera’s depth based on an OnBecameVisible event, things break. :frowning:

Example that is included in the latest project above:

void OnBecameVisible ()
{
	Camera.main.depth = 0;
}

Just to let you know, I’m running this by the dev team, but I think it will turn out that you’ve found a bug here.

its wrong for sure. this script was working just fine, then magically stopped working.

just keeps returning “seen” no matter what i look at.

function OnBecameInvisible  () {
//enabled = false;
//gameObject.tag = "null";
print ("gone");
}



function OnBecameVisible  () {
//enabled = true;
//gameObject.tag = "attract";
print ("seen");
}

I’m having problems with visibility functions to. :frowning: