Hello! I have combined two 8th Wall projectsâŠâA Frame: React Scavenger Huntâ and the âArt Galleryâ project. The goal is to switch between map and AR scenes.
I added code from the âArt Galleryâ project into the âReact Scavenger Huntâ project. Everything works as it should (i.e. the image targets are recognized and the metadata appears when the image target is found and Iâm able to add objects to the react map to represent points of interest).
The issue is the gold picture frame model (âframe.glbâ) from the âArt Galleryâ project is not appearing in the combined project.
Is it because models need a local web server since webpages (i.e. React) canât access the file system?
The project builds successfully, but I get this message in the consoleâŠ
%ccomponents:gltf-model:warn %cfetch for "https://myName-default-myCompany.dev.8thwall.app/assets/assets/frame.glb" responded with 404:
Any thoughts or ideas? I just want the frame model to appear when the image target is foundâŠeverything else works as it should.
Hi George! Thanks for the response. This is how Iâm referencing the asset (I hope this answers your question). If you look at the âReact Scavenger Huntâ project, the code can be found underâŠ"Files - views - ar - unitcude.html
You are right EvanâŠin my first post to the forum I included the console response that allows the project to be built successfully, but the frame.glb doesnât appear. When I try other paths like './assets/frame.glb the build fails. I was trying different paths when I sent the console message is my first post.
Here is what I get if I try â./assets/frame.glbâ
Build failed for [3efb083] with errors:
./views/ar/unitcube.html
Module not found: Error: Canât resolve â./assets/frame.glbâ in â/tmp/src/myCompany.htbpoimap-webar/views/arâ
A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double dot (âŠ), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy. A single dot represents the current directory.
The HTML file youâre referencing the asset from is located at /views/ar, so the relative path ./assets/frame.glb evaluates to /views/ar/assets/frame.glb.
If you take another look at the error message:
Canât resolve './assets/frame.glb' in '.../views/ar'
itâs telling you that /views/ar/assets/frame.glb does not exist.
If your asset is placed in the root /assets folder, then the correct relative path from this file would be ../../assets/frame.glb.