Arrow sometimes bounces off of rolling sphere

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hoc00

Hello,

I have a problem with collision that triggers only so many times (approx. 1 in 20) and I’m not sure how to fix it.

I have an arrow with following rigid body:
Mode: Character
Mass: 0.01
Weight: 0.01
Gravity Scale: 0
Contacts Reported: 2
Contact Monitor: On
Can Sleep: On

The sphere I shoot at is coming down a slope (angled down by around 45 degrees) and I’m shooting at it from bottom of the slope.
Here are the sphere’s rigid body properties:
Mode: Rigid
Mass: 1
Weight: 9.8
Gravity Scale: 1
Contacts Reported: 5
Contact Monitor: On

The arrow is shot using the method apply_central_impulse and the direction calculation is done using global_transform.basis.z (so that it fires towards the spheres)

On the arrow, I subscribe (connect) to body_entered event (signal) and apply damage if I’ve hit a sphere. If it has no health, I use queue_free to remove it. Otherwise, I add knockback which is also just a call to apply_central_impulse, but this time on the sphere.

The physics FPS is set to 60.

:bust_in_silhouette: Reply From: Snail0259

Try using an area2d with a seperate collision shape (the hitbox) which is slightly larger that the collision shape of the rigid body