Story:
You are little shy UniversalCamera
with ellipsoid hitBox attached via hitBox.position = camera.position
. Your hitBox has a PhysicsAggregate
, so you can participate in collisions, also it has spherePhysicsAggregate.body.disablePreStep = false
, so you can move around using keyboard keys.
There is evil bullet spawned around 40
units away which immediately was launched directly into your face. The collision definitely happened and the Bullet touched actorHitBox
message was posted in the console.
However, if bullet was spawned, for example, 120
units away it just flies through the hitBox and posts Bullet touched ground
when it lands on the ground somewhere behind you.
From my experiments in the playground, the distance threshold is 91
. If bullet is spawned further than that, the collision with hitBox is never detected.
The bug is very reproducible in my local app as well. If distance is more than around 100, the collision handler is not invoked.
The hitBox associated with camera is necessary condition. Bug is not reproducible if we just place the independent sphere somewhere as a target.
Playground: https://playground.babylonjs.com/#RE1THJ#4