How to convert a Unity Project to Web AR using Needle?

Hello Everyone,

I am very new with Needle. I have a unity project that I want to convert to AR. I have used google AR core in the past successfully and i want to do the same with needle, but in here i am a bit unsure about how to proceed. I already have a project setup with its needed interactive buttons and C scripts but the needle integration is not working as expected (i am using chatgpt as well to help me in here). i am very new to needle and needs some step by step assistance. if there are any documentations that show how to do it for your own projects, I’d appreciate the links. The youtube videos I’ve seen are mostly needles own templates used to make the AR. Also how should the hierarchy be placed for the needle integration to work ?

Hi Swaroop,

Here’s a quick overview of how to convert your Unity project to a Web AR experience with Needle:

  1. Update Your Unity Setup
    • Make sure you’re using the latest Needle Engine package (see the docs at Needle Engine Documentation).
    • Use the “Copy Project Info Into Clipboard” menu in Unity to verify your export settings. This helps spot configuration issues early.

  2. Configure the AR Camera
    • Replace (or augment) your standard Unity camera with an AR-enabled one by attaching the Needle WebXR component (details can be found in the WebXR API docs at Needle Engine).
    • This component sets up AR tracking and ensures your scene is correctly rendered in AR mode on supported browsers.

  3. Arrange Your Scene Hierarchy
    • Organize your scene so that your AR camera and interactive objects are under a common root—often an “ARRoot” with Needle configuration.
    • Ensure that interactive elements have the proper colliders and that an ObjectRaycaster is present in the hierarchy so events (like clicks) are properly received (check our sample “ClickExample” behavior for a reference).
    • Align your hierarchy similarly to Needle’s own AR templates, then gradually port your existing interactive buttons and scripts.

  4. Adapt Your Interactive Scripts
    • Since Needle Engine workflows lean toward using Typescript-based components (extending Behaviour rather than typical Unity components), you may need to adjust your C# scripts or reimplement key interactive parts in Needle’s component style.

  5. Build, Deploy, and Test
    • Use Needle’s build pipeline to export your project for the web.
    • Test your AR experience in supported browsers and devices to ensure everything (tracking, interactivity, etc.) works as expected.

For more detailed, step‑by‑step instructions and examples, check out the Needle Engine documentation and sample repository here:
• Docs: Needle Engine Documentation
• Samples: GitHub - needle-tools/needle-engine-samples: Live: https://engine.needle.tools/samples 🌵 Needle Engine sample scenes - use as examples and as a reference for learning 😊 (docs/embedding.html)

If you run into further issues, please consider sharing additional logs (using “Copy Project Info Into Clipboard”) or even a minimal reproducible example via Needle-engine - Vite Template (duplicated) - StackBlitz so we can help narrow down the problem.

Hope this helps you get started with converting your project to Web AR using Needle!

1 replies left - Become PRO for more replies.
thread_uT3XITuANTFqE8lJlQA0bQnY
Reply to this post directly if you need further help (bottom right button)