Unity collision distance settings

Official parameter explanation: Default Contact Offset

Unity - Manual: Physics (unity3d.com)

Sets the distance the collision detection system uses to generate collision contact. This value must be positive, if set too close to zero it may cause jitter. By default, this value is set to 0.01. Colliders only make collision contact if their distance is less than the sum of their contact offset values.

When Unity defaults to meters, the default distance is 0.01. Every time the scale decreases by 0.1, the distance should also decrease by 0.1.

For example: in the scene, we set several models that require fine distances to generate collision detection. If the size of the model in the scene is very small, the collision distance needs to be adjusted. Just set the minimum collision distance.

set up:

 

Practical examples

Before modification: At this time, the needle of the object has collided with the blood vessel.

 

 

After modification: Because the set value is relatively small, there is no collision between the needle and the blood vessel.

 

Guess you like

Origin blog.csdn.net/qq_18427785/article/details/127124388