Models disappear when the camera is pointing to it

Hi! I’m working on a project and I have an issue with the glb models.
When the camera moves or point to the models they appear and disappear constantly.
This only happens with some models, the ones who are closer to the camera.
I’ve already try to add the no-cull component to those entities, and setted the property near of the camera to a smaller number, but it still happening.
Here is a video of the issue.
WhatsApp Video 2024-06-12 at 09.38.54 (4)
Thanks!

Please reference this thread:

Hi Ian! Thanks for your response!
I’ve already tried that but the model still disappearing :cry:

how did you add the no-cull component? Can you specify?

Yeah! Shure!
First I addded the component to my app.js files

AFRAME.registerComponent('no-cull', {
  init() {
    this.el.addEventListener('model-loaded', () => {
      this.el.object3D.traverse(obj => obj.frustumCulled = false)
    })
  },
})

Then, I’m creating the entities through Javascript on the file where I’m creating the entity I’ve done this:

  const character1 = document.createElement('a-entity')
  character1.setAttribute('gltf-model', '#character1-glb')
  character1.setAttribute('shadow', {receive: 'false'})
  this.data.animationTarget.appendChild(character1)
  character1.setAttribute('visible', 'true')
  character1.setAttribute('no-cull')
  character1.setAttribute('animation-mixer', {
    clip: '*',
    loop: 'once',
    clampWhenFinished: 'true',
  })

can you try this syntax

character1.setAttribute('no-cull', '')

2 Likes

Hi Ian! That worked! Thanks for your help!

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.