Log in or register to post comments

How to detect ARCamera start

July 26, 2017 - 8:53am #1

I am trying to create a GUI button on top of the ARCamera. The problem is that it seems impossible to detect when to show the button.  If I attach a new script to ARCamera, all of the events get called at the start of the app, not when the scene with the ARCamera starts.

My script is named AR_GUI.  When the app starts, AR_GUI.Start, AR_GUI.Awake, and AR_GUI.OnEnable are all called immediately. I attached a listeners to SceneManager.sceneLoaded and that also gets called - with the name of the ARCamera scene - at the start of the app.

It seems impossible to detect scene changes in Unity, or when a gameobject is activated/displayed.

Any suggestions?

How to detect ARCamera start

July 26, 2017 - 11:02pm #2

I'm not sure I understood correctly, but if you wanna check gameobjects is displayed use OnBecameVisible()

https://docs.unity3d.com/ScriptReference/MonoBehaviour.html

Log in or register to post comments