Hi, two cameras. One point to a cube. It have a onmousedown event that set enable to camera 2.
It work right.
But attached in camera 2, i have some script, that i need to avoid execution, until button on camera 1 is pressed.
How can avoid script on camera 2?
If i disable camera2 in screen view, it can be activate at run time?
Kind of hard to follow exactly what youâre talking about without seeing some code, but it sounds like something that could be easily done with a public boolean on the script on camera 2 that doesnât get set to true until the button on camera 1 is pressed.
I think that i was confused.
âAll scripts attached to a Gameobject executed AWAKE event at run time.â
In order to execute a desired procedure, OnMouseDown event must to call it when event is fired.
Thatâs not really clear, posting your code could help. Every scripts execute awake first, in any case, you canât avoid that, if you want something to happen when you want, put that thing in the update function, with an âifâ statement, donât put it in the awake or start function. Or put what you want to be triggered by event in a static function and call that function when the event occur.