Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Resolved Hands colliding with body despite interactions disabled in layer collision matrix

Discussion in 'VR' started by -gregolego-, Aug 4, 2021.

  1. -gregolego-

    -gregolego-

    Joined:
    Oct 11, 2019
    Posts:
    2
    I'm starting to make a simple VR game with SteamVR. Player movement is controlled by a character controller. The player's hands keep colliding with the character controller, even though it's set to the same layer as the hands and the layer is set to not interact with itself in the layer collision matrix.

    I have also tried setting the hands to a different layer, and disabling interaction between that layer and the character controller's layer. That didn't work either.

    I want the controllers to freely pass through the player's body. What should I do?
     
  2. NevinAF

    NevinAF

    Joined:
    May 12, 2021
    Posts:
    36
    The SteamVR Hand objects actually spawn a separate game object that handles the graphics, and a separate game object that handles the colliders. This means that you have to change the layers on the prefab and not just the hand objects that start on the player in the inspector.

    Go to the project window and select: "./Assets\SteamVR\InteractionSystem\Core\Prefabs\ HandColliderRight.prefab". Here you can not only set the layer that the hands are on but also the layers that the hands will collide with (HandCollider->Collision Mask). You can do the same for HandColliderLeft.prefab.

    This should do the trick but if you have any questions, Let me know!
     
    -gregolego- likes this.
  3. -gregolego-

    -gregolego-

    Joined:
    Oct 11, 2019
    Posts:
    2
    That worked, thanks for the help!
     
    NevinAF likes this.