Is there some reason why this code doesn’t work? I cloned the basic Jellyfish Flyer project, added id=“jellymodel” to the jelly-glb model, and then ran the code below, which should hide the jellyfish model so I never see it. Instead, I get a “document.getElementById(…) is null”, even after wrapping the code in an onxrloaded event as recommended on this forum. I’m trying to use buttons to manage the display and hiding of various elements in an image target block, but it seems as if basic DOM functionality isn’t working for some reason
const onxrloaded = () => {
// Run any code that you'd like to execute after the body.html is loaded.
console.log('xrloaded start')
document.getElementById('jellymodel').setAttribute('visible', false)
console.log('xrloaded end')
}
window.XR8 ? onxrloaded() : window.addEventListener('xrloaded', onxrloaded)