OnCollisionEnter with relativeVelocity > 0 (without actual collision, distance > 0.5f)

Hi,
I have a pretty major problem, which I can’t manage to solve…
There’s a script with OnCollisionEnter() function attached to Rigidbody with Sphere Collider (it’s a ball). This script just logs relative linear velocity of the two colliding objects.

Bounds for Sphere and Box Colliders you can see in the image below - distance between both these colliders is 0.5f.

Problem: Collision is recorded when there is none (distance = 0.5f).
In Physics settings:

  • Default Contact Offset: 0.01

  • Contacts Generation: tried both PCM (Persistent Contacts Manifold) and Legacy Contacts Generation. No difference.

Any ideas?

Hi,
Have you checked so there are no scaling problems in the parents?
All parents to the objects should have the scale 1,1,1, all the way to the top.

1 Like

Ok, will have to re-import assets and try with scale = 1,1,1

Ok, so, as suggested by @arfish , I re-imported all assets, so that I shouldn’t scale them - it really did the job! Thank you! :slight_smile: