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. Dismiss Notice

Feature Request XRGrabInteractable: Track rotation, but keep initial rotation

Discussion in 'XR Interaction Toolkit and Input' started by freso, Jul 23, 2021.

  1. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    72
    With XRGrabInteractable.trackRotation = true, the interactables rotation is set to the interactor grabAnchor rotation when grabbed.

    This is good sometimes, like forcing a weapon to be correctly positioned in hand, but bad sometimes, like when picking up something and trying to turn it over and over.

    I propose adding a flag similar to smoothRotation. Something like keepInitialRotation. When this is true, you should not copy the rotation from the interactor, when the object is grabbed.
     
    Wexyfox and CamSlalom like this.
  2. Memoriesin8bit

    Memoriesin8bit

    Joined:
    Feb 20, 2020
    Posts:
    10
    I am looking for the same feature.
    Or at least suggestions on how this could be achieved.

    I suppose a workaround might be to change the rotation of AttachTransform to the one of the object we have selected/are hovering on. But sort of an "official" solution would be neat.

    EDIT: I made a small helper script that allows "relative grabbing". In case anyone wants it, there you go.
    I am sure there are better ways to do this and I welcome your feedback - I am just starting out with XR.
     

    Attached Files:

    Last edited: Apr 22, 2022