Open itdat opened 9 months ago
You might need to set the active collision types to include KINEMATIC_FIXED.
E.g.,
<BallCollider args={[5, 5]} activeCollisionTypes={ActiveCollisionTypes.DEFAULT | ActiveCollisionTypes.KINEMATIC_FIXED} />
According to the documentation, collision detection between fixed and dynamic is disabled by default (https://rapier.rs/docs/user_guides/javascript/colliders#active-collision-types).
I am encountering an issue in React Three Rapier where a BallCollider passes through a HeightfieldCollider without any collision detection. This issue does not occur when the HeightfieldCollider is replaced with a CuboidCollider, where the BallCollider correctly collides and stops.
The setup consists of two RigidBodies, one with a BallCollider and the other with a HeightfieldCollider. The BallCollider is set with a dynamic type and positioned above the HeightfieldCollider.
Here's a snippet of the relevant code:
The expectation is for the ball to collide and interact with the heightfield surface. However, in practice, the ball passes through the heightfield collider as if it's not there.
This behavior is observed consistently and can be replicated using the above code. Interestingly, when the HeightfieldCollider is replaced with a CuboidCollider, the ball behaves as expected and stops upon collision.
Here is a screenshot illustrating the issue:
I am looking for insights into why this might be happening and how to resolve it. Is there a specific configuration that I am missing, or could this be a potential bug in the library? Any help or guidance would be greatly appreciated.
Thank you!