xr-unity icon indicating copy to clipboard operation
xr-unity copied to clipboard

XRImageDetection callback

Open GimpMaster opened this issue 5 years ago • 7 comments

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

GimpMaster avatar Nov 11 '18 03:11 GimpMaster

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?

atomarch avatar Nov 12 '18 18:11 atomarch

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.

GimpMaster avatar Nov 12 '18 21:11 GimpMaster

Yes, that works too :)

atomarch avatar Nov 12 '18 21:11 atomarch

I follow the instruction in guide using XRImageDetectionTargetController, but when i test the apk, the image detection not works. What is the solution?

salvator12 avatar Dec 25 '18 16:12 salvator12

@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.

atomarch avatar Dec 26 '18 06:12 atomarch

It would also be useful to have a callback if the target image tracking is lost ... Am I wrong or completely missing?

D3m0n92 avatar Nov 19 '19 11:11 D3m0n92

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

mralbean avatar Nov 19 '19 18:11 mralbean