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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question SteamVR_Behaviour_Skeleton glitches

Discussion in 'VR' started by Arzana, May 25, 2020.

  1. Arzana

    Arzana

    Joined:
    May 25, 2020
    Posts:
    3
    I'm having an issue with the internals of the hand physics with the SteamVR plugin.
    I'm currently working on a non-euclidean title and we're detaching the hands from the player in order to teleport them to the other side of a portal.
    This solution works pretty well, but the transform of the SteamVR_Behaviour_Skeleton lags behind by about 4 frames. This causes the hand to visually glitch and breaks the the otherwise smooth teleportation. I assume that the skeleton is storing a positional buffer somewhere in order to estimate the final position of the hands instead of taking the raw tracking data. I think just clearing this buffer might solve my issue, but I don't know if it exists and if so, how I can clear it.
     
  2. Arzana

    Arzana

    Joined:
    May 25, 2020
    Posts:
    3
    I believe that these might be stored in the sourceMap of the SteamVR_Action_Skeleton. This is because the GetLocationPosition is used in the skeleton to get the transform position.
     
  3. Arzana

    Arzana

    Joined:
    May 25, 2020
    Posts:
    3

    https://imgur.com/a/dyHrHEj

    This is what the convergence look like, the amount of frames it takes to catch up varies a bit.
    Measured as follows (in Hand.cs Update):

    Code (CSharp):
    1. Vector3 p = transform.position;
    2. Vector3 q = skeleton.transform.position;
    3. Vector3 e = q - p;
    4. Debug.Log($"\nHand: [{p.x:0.##}, {p.y:0.##}, {p.z:0.##}]\tSkeleton: [{q.x:0.##}, {q.y:0.##}, {q.z:0.##}]\tError: [{e.x:0.##}, {e.y:0.##}, {e.z:0.##}]");