Iām creating a project using the muti scene react method of changing from scene to scene without reloading the page.
I have added a new scene but Iād like to attach two components, but when I try it doesnāt work.
I tried as an array
components={[recenterButtonComponents, treeComponents]}
Didnāt work
I tried just separating them with comma, didnāt work.
components={recenterButtonComponents, treeComponents}
I tried adding a second line repeating components
components={recenterButtonComponents}
components={treeComponents}
Here is what my code looks like, Iād like to add multiple components within this statement.
<AFrameScene
sceneHtml={require(ā./tree.htmlā)}
components={recenterButtonComponents}
/>
you must use if you want change the the scene or create button to direct to other page
Hi Rama,
I understand I have to use REACT, but my question is how can I add multiple components (the example they give in the tutorial only has one component defined, I would like to add more, but when I add a second component using a comma it doesnāt work.
In my example below I have ārecenterButtonComponentsā I would like to add a second component called ātreeComponentsā
components={[
{name:āexampleā, val:recenterbuttonComponents},
{name:āexampleā, val:treeComponents},
]}
1 Like
Thanks Rama,
Iām still just getting my head around doing things the original way and migrating it over to use the React scene switchingā¦ Nothing like learning on top of learning eh!!
Thanks again.
yess you can use repo on 8thwall github react scene.
so this will be help you, and dont forget learn typescript too for good script haha
BAAAAA I wish I had time for learning another languageā¦ maybe once i get this project out the door Iāll look more into it.
Spending a lot of time learning intricacies of exporting blender objects and animations as useful glb files, baking keyframes and textures, learning how to export mesh deformations and materials as well.
Itās starting to take shape and itās looking great so far, canāt wait for more of this to be baked into my subconscious so I can do more playing then learning.
Hey Ram, thanks for the code, but when I implement it I donāt get any errors but those components donāt seem to get passed, as my recenter disappears where it was working with just components={recenterButtonComponents}
but once I switched to your method of including multiple components it doesnāt crash but I donāt see my recenter button so Iām not sure what I have wrongā¦
components={[
{name:ārecenterā, val:recenterButtonComponents},
{name:āhotspotā, val:tapHotspotComponents},
{name:āclosehotspotā, val:tapCloseComponents},
]}
can you share the full code?
import {AFrameScene} from āā¦/lib/aframe-componentsā
import {FloatingBackButton} from āā¦/lib/material-ui-componentsā
import {TreeSceneComponents} from āā¦/components/tree-componentsā
import {recenterButtonComponents} from āā¦/components/recenterā
import {tapHotspotComponents} from āā¦/components/tap-hotspotā
import {tapCloseComponents} from āā¦/components/tap-closeā
declare let React: any
declare let ReactRouterDOM: any
const {withRouter} = ReactRouterDOM
const SphereScene = withRouter(({match}) => (
<React.Fragment>
<AFrameScene
sceneHtml={require(ā./kiosk_sphere.htmlā)}
components={recenterButtonComponents}
/>
</React.Fragment>
))
export {SphereScene}
**when I replace the components line with what you sent it doesnāt workā¦