// Special case for an emty world to avoid rapier crash
if (phys.world.colliders.len() === 0) {
return null // Will crash if there are no colliders
}
let proj: PointColliderProjection | null = null
try {
proj = phys.world.projectPoint(
point,
solid,
undefined,
undefined,
undefined,
undefined,
(collider) => {
return false // <- this will cause a crash as well
},
)
} catch (e) {
log.error('Error projecting point:', e)
log.x('point:', point, 'solid:', solid)
return
}
If my filter filters out all colliders world.projectPoint crashes
See code below for two crash examples