Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Small Colliders Colliding When They're Not Expected To

Discussion in 'Editor & General Support' started by boone0694, Feb 1, 2022.

  1. boone0694

    boone0694

    Joined:
    Jan 7, 2018
    Posts:
    6
    Hello All,

    I have a problem in my project that I'm struggling to understand. I'm sure there is some physics or collision value that I need to adjust to make this work, but I'm not sure what that might be.

    When I grab my object in game mode, with the XR grab interaction, and move it "near" my boxes I want to collide, it collides much farther away than I want/expect.

    I have 1 object, a scalpel, with a Rigidbody and a small sphere collider. I have the XR Grab interactable using velocity tracking. The big box on the handle of the scalpel is a trigger to grab from the XR interactable. The scalpel is on the "Cutter" layer and the boxes are on the "Cuttable" layer.

    Scalpel settings:
    1.png

    Sphere collider on the scalpel:
    2.png


    When I run the scene, I grab the scalpel, place it near these boxes and it collides way farther away than the sphere collider is, as seen here:
    3.png
    Reference image of the boxes before play; these have a script that checks "OnCollisionEnter" and if it does, disables the gameobject:
    4.png
    Here is my collision matrix to show cuttable (boxes) only affected by cutter (scalpel):
    upload_2022-2-1_10-0-49.png

    Hopefully I added enough detail to present a straightforward question.

    My hypothesis are:
    1) There is a scale factor for collisions that I need to set lower somewhere
    2) The velocity tracking portion of the XR Grab interactable is creating/adjusting some collider I can't see
    3) I messed up my layer collision
    4) Something is up with my Rigidbody collision detection


    Thank you for all the help; have a wonderful day!
     
  2. boone0694

    boone0694

    Joined:
    Jan 7, 2018
    Posts:
    6
    I was able to figure out what was happening. My hypothesis 1) was correct. I needed to decrease the "Default Contact Offset" in the "Project Settings/Physics" tab. 5.png
     
    Kurt-Dekker likes this.