xr-unity
xr-unity copied to clipboard
XRImageDetection callback
One of the things that was a little confusing is your XRImageDetectionTargetController in the case of the OnImageTargetDetected callback.
What I found is that it does not get called each time it detects the image, it will get called ALWAYS once the image was first detected. So if you put a Debug.Log("image detected") you will get it spammed forever even when no longer looking at the image.
Correct me if I'm wrong. Thanks
Hi @GimpMaster , thanks for reporting, we will look into this. For now, can you try adding a boolean at the top of the class, for example private bool found = false;
and then in the MoveToTarget() function wrap the two transform statements in a if (!found)
and set found = true;
in there, so that it only gets called once?
One other option that I liked better was to save off the position that was reported. Then if it ever changed act upon it.
On Nov 12, 2018, at 13:26, Tony Tomarchio [email protected] wrote:
Hi @GimpMaster , thanks for reporting, we will look into this. For now, can you try adding a boolean at the top of the class, for example private bool found = false; and then in the MoveToTarget() function wrap the two transform statements in a if (!found) and set found = true; in there, so that it only gets called once?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Yes, that works too :)
I follow the instruction in guide using XRImageDetectionTargetController, but when i test the apk, the image detection not works. What is the solution?
@salvator12 what type of device are you using and does it support ARKit 1.5+ or ARCore 1.5? Please see https://docs.8thwall.com/xr/#features-supported-by-platform for a matrix of features supported by platform.
It would also be useful to have a callback if the target image tracking is lost ... Am I wrong or completely missing?
It would also be useful to have a callback if the target image tracking is lost ... Am I wrong or completely missing?
You determine whether the image tracking has been lost through its tracking state: https://www.8thwall.com/docs/xr/#xrdetectedimagetargettrackingstate