Search Unity

Question Is there a way to override rotation/position updates?

Discussion in 'XR Interaction Toolkit and Input' started by edwon, Aug 21, 2022.

  1. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    I want to customize position and rotation updates further with custom smoothing, rotation on only certain axes, etc... Is there a way to override these in inheriting classes from XRGrabInteractable?
     
  2. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    231
    At the moment,
    XRGrabInteractable
    isn't very overridable since most of the methods are private. In the next 2.2 version of XRI, we have added Grab Transformer classes that allows you to put your logic for computing the target pose of the interactable without needing to derive from XRGrabInteractable. That version is scheduled to be made available as pre-release by November.

    In the meantime, you will have to derive from ProcessInteractable and capture the current Rigidbody/Transform poses before calling the base method, and then do additional processing after calling the base method.
     
  3. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    ok will try deriving from ProcessInteractable