Search Unity

Question VR XRBaseInteractable.MovementType VelocityTracking and lag during movement

Discussion in 'XR Interaction Toolkit and Input' started by cibernaio, Feb 11, 2023.

  1. cibernaio

    cibernaio

    Joined:
    Oct 16, 2022
    Posts:
    11
    Hi everyone,
    i'm learning to develop with vr and the xr module.
    I wanted to know
    if there is a possibility to reduce the lag of a grabbed object while moving with the stick,
    while retaining physics, i.e.:
    XRBaseInteractable.MovementType = VelocityTracking

    This problem occurs while I'm grabbing an object and moving with the stick.

    I attach the video where you can see the annoying lag.

    Of course if imposed

    XRBaseInteractable.MovementType = Instantaneous / kinematic

    the object moves without lag but loses physics, it means that if I hit a ball I will go through it and therefore create another problem.

    Thank you

    ezgif.com-optimize.gif
     
    Last edited: Feb 26, 2023
  2. cibernaio

    cibernaio

    Joined:
    Oct 16, 2022
    Posts:
    11
  3. cibernaio

    cibernaio

    Joined:
    Oct 16, 2022
    Posts:
    11
    Does anyone have any suggestions?
    Thx
     
  4. mikeNspired

    mikeNspired

    Joined:
    Jan 13, 2016
    Posts:
    82
    I dont have my headset to try it at the moment.
    But a couple years ago, I used to do something like child velocity tracked objects to the player when I was moving.
     
  5. ericprovencher

    ericprovencher

    Unity Technologies

    Joined:
    Dec 17, 2020
    Posts:
    267
    You can try increasing the physics tick rate to match your hmd’s refresh rate. There will likely always be some lag though because displacement happens from physics ticks, and velocity moves the object as that’s how you retain collisions, but a higher tick rate should alleviate some of the lag.