I just downloaded unity and needle engine and opened the ImageTracking scene,How do I scan an image for testing in the browser? I’ve plugged the camera into my computer
To test AR image tracking in Unity and view it in Chrome, follow these steps:
-
Ensure Chrome Configuration: For Android, enable the
image-tracking
feature in Chrome flags. You can do this by visitingchrome://flags/#webxr-incubations
and enabling the flag (see releases). -
Prepare Your Scene:
- Open the ImageTracking scene in Unity.
- Make sure that you have a camera correctly set up to access the device’s camera.
-
Add Image Tracking Component:
- Ensure you have the
WebXRImageTracking
component set up. This component will handle the image tracking logic and requires a tracked image and the corresponding object to display when the image is detected.
- Ensure you have the
-
Specify Tracked Image:
- In the
WebXRImageTracking
component, specify the image you want to track as well as its dimensions in meters. This is crucial as the tracking may not work accurately if the dimensions do not match the physical marker size (see the documentation).
- In the
-
Build Your Project:
- Build the project for WebGL in Unity.
-
Test in Chrome:
- Open the hosted WebGL build of your project in Chrome.
- Allow camera permissions if prompted.
- Point your camera at the specific image marker that you are tracking to see the AR overlay.
-
Troubleshooting:
- If tracking isn’t working, ensure your image has good contrast and is distinct enough for the AR system to recognize (see the documentation).
Feel free to ask if you need further assistance or a more detailed guide on any specific step!
1 replies left - Get a PRO license for more AI replies.
thread_ld9GLm3zccG910TUUEzzPnX8
Reply to this message to continue the conversation
How?I am on a windows system, and I have opened it with permissions, but whether it is your example Image Tracking | Needle Engine or starting server in unity, it does not work There is no real camera field of view.
To troubleshoot the issue of not having a real camera field of view while trying to test AR image tracking in Unity on a Windows system with Needle Engine, you can follow these suggestions:
-
Check Camera Permissions: Ensure that the Chrome browser has permission to access your camera. You can do this in Chrome settings under Privacy and Security.
-
Setup WebARSessionRoot: Make sure that you’ve added the
WebARSessionRoot
component to your scene. This is crucial as it manages the session and camera settings for AR. Without it, the AR features may not function correctly (see the documentation). -
Correct Camera Setup:
- Validate the camera’s configuration settings. Make sure it’s set to the correct resolution and that the aspect ratio matches that of the device you are using.
- Check if your computer’s camera is the primary camera being accessed. You might want to switch to another camera from the available devices if there are multiple.
-
Use the Correct Image Size: In the
WebXRImageTracking
component, ensure that the physical size of the image being tracked is accurately defined. This size must match the real-life dimensions of the marker for effective tracking. Adjust theWidthInMeters
property accordingly (see the documentation) (see the documentation). -
Testing in Chrome: When testing your project in Chrome, make sure to access the hosted version of your WebGL project, not a localhost version if it has not been set up to support WebXR features (see everywhere actions).
-
Enable WebXR Flags: Double-check that you have enabled the necessary flags in Chrome for WebXR, especially for testing AR features. Visit
chrome://flags/#webxr-incubations
and ensure that it’s enabled.
If you still experience issues, reviewing the console logs in Chrome can provide insights into what might be going wrong. If the camera view is not being displayed, it might be helpful to look at any error messages related to camera permissions or WebXR session failures.
Let me know if there’s anything more specific you’d like assistance with!
1 replies left - Get a PRO license for more AI replies.
thread_ld9GLm3zccG910TUUEzzPnX8
Reply to this message to continue the conversation
Hello, did you open the scene on your Android phone?
Which phone are you using and does it have AR capabilities? You need to enter AR by clicking the “Enter AR” button in the menu at the bottom (you might need to first open the submenu (the 3 dots))