Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Steam VR Hands stop colliding after Throwable is picked up

Discussion in 'AR/VR (XR) Discussion' started by wuannetraam, Jun 6, 2020.

  1. wuannetraam


    Oct 29, 2019
    This is such a weird issue we are experiencing. When I grab an object and drop it again the collisions of the hand which I grabbed the object with stops working. And sometimes it randomly starts colliding again when Im in a different part of the level. I have no clue why this is happening. I've recorded my screen so you can see what I'm talking about.

    I hope someone has an answer to this.
  2. a436t4ataf


    May 19, 2013
    Your screen recording is nice but doesn't let anyone help you in any way. It's your source code and scene that are the important things - if you've done something wrong, or if you've found a bug in XR, you need to dig into your scene and scripts and find which bit is going wrong.

    (if you don't know which bit has gone wrong, no-one can help you. You need to investigage yourself and find out which method call isn't happening, or which line of code isn't running, etc. I HIGHLY recommend using the Debugger - it will make this extremely easy. Your IDE (Rider or VS) should have a built-in debugger, and you need to breakpoint the lines of code that you expect to run, and then step through them to see what's actually happening).
  3. wuannetraam


    Oct 29, 2019
    Im using the default Player prefab from Steam VR without modifying anything. In my scene Im using Playmaker for all the logic. No lines of code written by me. Strange thing is that it randomly works again after a while. Maybe I can upload a demo project for people to test?
  4. I'm running into the same issue. No scripts edited or anything.

    If you've found an answer to this problem, could you share please?
    Last edited by a moderator: Jun 17, 2020
  5. nohrr_


    Jul 30, 2019
    I too am having this problem with absolutely no indication as to what's causing it. No scripts have been modified, this is happening because of something in the XR Interaction system...
  6. repulles3


    Jan 21, 2014
    I have the same problem. I have found that the errror only plays when the hands are inside a collider (audio collider, volume collider, ...). If the hands are out, your colliders will work correctly. Does anyone know if any of the Steam scripts check if the hands are inside or outside of a collider for proper operation?
  7. Valektrum


    Mar 16, 2021
    We are late on this but we found a solution. In the script HandPhysics.cs, find the UpdatePositions function and change the first few lines to

    Code (CSharp):
    1. private void UpdatePositions()
    2.         {
    3.             // disable collisions when holding something
    4.             if (hand.currentAttachedObject != null)
    5.             {
    6.                 collisionsEnabled = false;
    7.             }
    8.             else
    9.             {
    10.                 /*// wait for area to become clear before reenabling collisions
    11.                 if (!collisionsEnabled)
    12.                 {
    13.                     clearanceBuffer[0] = null;
    14.                     Physics.OverlapSphereNonAlloc(hand.objectAttachmentPoint.position, collisionReenableClearanceRadius,
    15.                         clearanceBuffer);
    16.                     // if we don't find anything in the vicinity, reenable collisions!
    17.                     if (clearanceBuffer[0] == null)
    18.                     {
    19.                         collisionsEnabled = true;
    20.                     }
    21.                 }*/
    22.                 collisionsEnabled = true;
    23.             }
    24. .....
    It changes the physics a little bit, but we found that it was a good solution. There may be better one.