Camera Gets Stuck Inside Prop When Moving Around – What Could Be Causing This?

Hi Babylon.js community :waving_hand:

I’m working on a 3D application where I load and instance props (furniture, displays, etc.) into a scene. Each prop is exported from Blender with a hierarchy like this:

Root (TransformNode)
├── visible (high polly mesh)
└── colliders (low polly mesh)

At runtime, I use instantiateHierarchy on the root node so that the entire prop — including both visible and colliders — is instanced as one unit. The visible mesh has checkCollisions = false and the colliders mesh has checkCollisions = true. I freeze the world matrix on both submeshes after instancing.

Everything works great in terms of rendering and instancing, but I’m noticing an issue when navigating the scene using the free camera.

:red_exclamation_mark: Issue:

When I move the camera around, it sometimes gets stuck or “caught” inside a prop as seen in the video below.

Here’s a quick video showing the issue in action:
:link: Video link (Screencastify)

It only happens in certain spots, and seems to depend on the angle of approach. I’ve triple-checked that:

  • The collider mesh is invisible but enabled.
  • The visible mesh is not collidable.
  • There are no stray child meshes or artifacts.

:magnifying_glass_tilted_left: What I’m trying to understand:

  • What is causing camera to get stuck and start jittering?
  • How to fix this issue?

Thanks in advance!

Jittering is caused by the collision detection and response itself. It’s an old system that try to find a valid position after a collision and that new position is changed again the next frame with a new valid position.

cc @georgie