07-01-2021, 05:52 PM
For others looking for a solution to an obi simulation lagging behind a VR controller in unity; this is the solution. In the case of VR, it is important for player immersion to have the visual of whatever they are holding to update as late as possible to have it feel like they are holding it. In my case, I have a rod / rope attached to an object in the players hand and it would visually lag one frame behind and noticeably detach when the player waved their hand.
With Unity's XR Interaction toolkit I found that you can swap the Fixed Updater for "Obi Late Fixed Updater" on your Obi solver and it will solve the problem while allowing you to keep the tracking type of the VR controllers to "Update and Before Render". The lower quality of the simulation is ok since the rope will be in constant movement in the players hand and not be as noticeable... though it seems the late fixed updater is attempting to account for the time disparity anyway... so potentially the best of both worlds? Does the late fixed updater produce simulation quality on par with the standard fixed updater?
Anyway, having the updaters modular and swappable is very helpful, thank you. If this solution still has issues lagging in certain cases, you could probably create an updater that listens to the controller and invalidates when the controller updates.
With Unity's XR Interaction toolkit I found that you can swap the Fixed Updater for "Obi Late Fixed Updater" on your Obi solver and it will solve the problem while allowing you to keep the tracking type of the VR controllers to "Update and Before Render". The lower quality of the simulation is ok since the rope will be in constant movement in the players hand and not be as noticeable... though it seems the late fixed updater is attempting to account for the time disparity anyway... so potentially the best of both worlds? Does the late fixed updater produce simulation quality on par with the standard fixed updater?
Anyway, having the updaters modular and swappable is very helpful, thank you. If this solution still has issues lagging in certain cases, you could probably create an updater that listens to the controller and invalidates when the controller updates.