Search Unity

Bug XR Grab Interactable not working correctly with Mesh shape

Discussion in 'XR Interaction Toolkit and Input' started by pixelfilm, Feb 19, 2021.

  1. pixelfilm

    pixelfilm

    Joined:
    Feb 15, 2021
    Posts:
    10
    When I grab the mesh object, it is not near my hand at all. I've used both a mesh collider and a box collider, but both place the object far away each time I grab it.

    When I grab a simple cube, it works fine.

    Any suggestions? I'm using 2019.4.20f1with XR Interaction Toolkit .10 preview 7
     
  2. lbaeeba

    lbaeeba

    Joined:
    Aug 28, 2018
    Posts:
    1
    Hi Pixelfilm, it might be, that the origin of the object is dislocated. Means that the object you imported, for example from Blender does not have the origin at the center of the geometry but somewhere else. You can test this buy trying to move the object, when the axis are not located at the center you will know the origin is off.
    Buy the way, better use box colliders then mesh colliders if you are interacting with stuff.
     
  3. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    By default, a Grab Interactable object will attach to the Interactor selecting it using its Transform pivot pose. You can override where the attachment point is by creating a child GameObject of the Grab Interactable and assigning it to the Attach Transform value in the Inspector window. When using the Unity Editor, you can use the Center/Pivot button to determine where the pivot position is.

    There is currently a bug as of 1.0.0-pre.3 with the attach position being incorrect when using Instantaneous movement type for objects which have a center of mass different from the Transform position. That will be fixed in the next 1.0.0-pre.4 version of the package.
     
  4. pixelfilm

    pixelfilm

    Joined:
    Feb 15, 2021
    Posts:
    10
    Thank you!