OnBecameInvisible() not working on AR Object
Hello everyone,
I have an AR Spider, which I added to my scene using Vuforia. I need to count how many seconds this object was visible by the user. I know in order to do something if the object is visible by any camera, OnBecameVisible() is used. Since I'm a real, actual newbie in Unity, first I checked if this function does what I need. so I wrote the following script:
void OnBecameInvisible() {
//do something here
Debug.Log("out of range!");
}
void OnBecameVisible(){
Debug.Log("inside range!");
}
Then I turned my webcam on, showed my image target to the webcam, my spider successfully appeared on the image target, and finally I throw the image target out of webcam range. During all these steps, none of my messages were printed in consul.
It made me wonder, is there another function I need to use, in order to track my AR object on the camera zone? Or is there something I'm doing wrong here?
Any sort of help would be appreciated. It made me wonder,