question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rigidbody Tracked Interactables lag way behind Axis Movement

See original GitHub issue

Environment

  • Source of VRTK: GitHub master
  • Version of VRTK: v4 beta
  • Version of the Unity software: 2019.1
  • Hardware used: Oculus
  • SDK used: UnityXR

Steps to reproduce

  1. in the example scene change the hammer follow type to FollowRigidbody
  2. start the scene and switch to axis control
  3. grab the hammer and move with axis control

Expected behavior

The hammer should follow the controller without any lag

(see v3.3 functionality)

goodfollow

Current behavior

The hammer lags behind the controller considerably

badfollow

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thestonefoxcommented, Apr 27, 2019

Moving all of the relevant follow processes to fixed update and in the correct sequence does work (but is a clunky workaround)

image

This is all in the AxesToVector3 moment processor:

  • Do AxesToVector3 movement first
  • Then move play area to follow alias
  • Then move controller alias to follow tracked controller
  • Finally move tracked object to follow controller alias

workaroundfollow

1reaction
thestonefoxcommented, Apr 26, 2019

The issue is a race condition in the fixed update routine.

If the Rigidbody Follow FixedUpdate processes before the AxesToVector3 FixedUpdate (via their respective MomentProcessors) then the issue occurs.

However, if the AxesToVector3 processes before the RigidbodyFollow then it works fine.

This can be confirmed by disabling the moment processor on the RigidbodyFollow and adding the MomentProcess from the RigidbodyFollow to the AxesToVector3 MomentProcessor List (in the second element slot).

This ensures the FixedUpdate processes the axis movement before processing the rigidbody follow and removes the issue.

The reason it worked in v3.3 was pure fluke of how the components in the example scene were saved so the race condition didn’t occur. but it is possible to recreate the issue in v3.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly fix camera and rigidbody stutter / jitter / lag?
At first sight it's nice, player is not lagging, everything around is moving smooth, but when player moves, then everything else ...
Read more >
XR Grab Interactable | XR Interaction Toolkit | 2.3.2
Interactable component that allows for basic grab functionality. ... it can appear to lag behind and not move as smoothly as Instantaneous.
Read more >
VR in Unity: Advanced Grab Interaction Behaviors
Velocity Tracking : Some delay in movement tracking while held which can be seen as jittery. Will collide with every object regardless of ......
Read more >
XR Grab Interactable | XR Interaction Toolkit | 2.0.4
Set Movement Type to Velocity Tracking to move the Interactable object by setting the velocity and angular velocity of the Rigidbody. Use this ......
Read more >
UnityXR Jittery/Lagging Grabbables. 3 Ways to fix. - YouTube
This is a generic tutorial about the UnityXR toolkit, but 100% applies to the handposer. First Way : Dealing with Rigidbody center of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found