Search Unity

How to stop SteamVR hand objects physically colliding with objects with colliders?

Discussion in 'AR/VR (XR) Discussion' started by benjaminoutram, Feb 9, 2020.

  1. benjaminoutram

    benjaminoutram

    Joined:
    Nov 10, 2014
    Posts:
    20
    I have geometry that I want the hands to go through without colliding with them. Normally I would just put the colliders of two objects on different layers and make the layers unable to interact in the Physics settings. But SteamVR complains if I put all the objects under the 'player' prefab to 'default' of anything else, and I don't know what layer the hands are on or how to change this.

    Anyone know?
     
  2. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    you can set unity physics to ignore any collider interaction via Physics.IgnoreCollision

    If you take reference of the collider you wish ignore at On Collision Enter, you can set your hands to ignore it.
     
  3. philipprapp95

    philipprapp95

    Joined:
    Dec 30, 2017
    Posts:
    1
    Late answer, but if anyone else is having the same issue, here's the solution:

    The Collision-Layer of the hands is not set in the Playerprefab or it's childs itself. Go to the "LeftHand" or "RightHand" child of the Playerprefab. Here you'll find the "Hand Physics" Script. There's a component called "Hand Collider Prefab". Click on it to open the prefab. Here you can adjust the layer the hand collision is based on. It's different for the left and right hand, so don't forget to change the layer in both. Last step is as usual to change the Layer Collision Matrix in Edit->Project Settings->Physics
     
    jojo138, ethanicus and JonR79 like this.
  4. JonR79

    JonR79

    Joined:
    May 13, 2018
    Posts:
    9
    I've been looking at this problem for a week and I NEVER noticed the Hand Physics script on the hands!

    Thank you so much!