Hi. Iām trying to add some AR Scenes to my already existing next.js project (app router) and Iām having some issues with the installation. Every time I click āinstallā it errors out. Does anybody have any idea whatās wrong?
My app is blog style with some AR components. For each article there will be videos, images and sometimes a 3D AR scene to play with. I was wondering, is there a way to do this? Iāve tried reverse engineering the needle website to give me a steer but any advice would be appreciated.
Ok sure. Yep totally possible. You can e.g. have one main scene in Unity that has a scene switcher component and just use it to reference other prefabs or scenes to be exported.
Then in your blog/website you can directly set the src attribute on the Needle Engine web component (or the react needleEngine next component, pass it in as a prop) to load one of the glbs that were exported from Unity.
For Example: in Unity you have it setup to export to your next project and your main scene has a SceneSwitcher with āSceneAā and āSceneBā
Then in your blog depending on the article you add the needleEngine tag with <needleEngine src="./assets/sceneA.glb"> ~ roughly like that. I hope you get the idea?
the needle engine website is just one big page that loads the referenced scenes inside one page on demand. From your description it sounds like each page has its own needle-engine canvas and you want it to display a separate scene depending on the article. correct me if I got that wrong
Both is possible. For a similar behaviour as on our website youād also use the SceneSwitcher and just add some js code to tell it which scene you want to load (e.g. depending on scroll or a button pressā¦)