cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus Custom Hands - Stutter

DemonGamesLab
Protege
I am trying to implement custom hands, for some reason it stutters / lags. I set the frame time to 90fps which helps a bit but still way too laggy. I have searched online for a long time and can not seem to find any answer.

To be more specific, it is just the hands that lag / stutter. Seems to do it more when moving or turning. The custom hands are not attached to the OVR player controller, attaching them seems to make them disappear.

Can anyone explain whats going on or has the same experience?

** I have already tried setting the time settings to 1/90 which is 90 frames per second. This does not stop the jitter / stutter / lag with the hands.

Thank you in advance.
9 REPLIES 9

Cyrussphere
Honored Guest
If you are using Unity there is a Time setting that can be adjusted to help. Its covered a little bit in this video https://www.youtube.com/watch?v=rnOR1OANIAU&list=PLrk7hDwk64-Y7ELKfkw8ox8TaT9y3gNpS&index=2

DemonGamesLab
Protege
I know there is. I did say in the post that I changed the frame time to 90fps. I will try to edit the post to be more specific.
** Edit. I have also seen and been through those videos multiple times.

Anonymous
Not applicable
How are you updating the hand's positions? There's an event in OVRCameraRig called UpdatedAnchors. If you subscribe to that you will get a callback at exactly the same time that Oculus updates the position of the controllers in the tracking space. It shouldn't be possible for the hands to lag in that situation.
using UnityEngine;

public class HandTracker : MonoBehaviour
{
[SerializeField]
OVRCameraRig cameraRig;

[SerializeField]
Transform leftHandTransform;

[SerializeField]
Transform rightHandTransform;

void Start()
{
cameraRig.UpdatedAnchors += OnUpdatedAnchors;
}

private void OnDestroy()
{
cameraRig.UpdatedAnchors -= OnUpdatedAnchors;
}

private void OnUpdatedAnchors(OVRCameraRig rig)
{
leftHandTransform.SetPositionAndRotation(rig.leftHandAnchor.position, rig.leftHandAnchor.rotation);
rightHandTransform.SetPositionAndRotation(rig.rightHandAnchor.position, rig.rightHandAnchor.rotation);
}
}


Anonymous
Not applicable
Another thought: Do you have any animations on the hands that might be setting their position? There could be a fight between the animation position and the VR position that looks like jitter?

DemonGamesLab
Protege
I am very confused. I am currently using the custom hands that Oculus provide.

* Edit. I tried making my own script with the code you said, and while it actually fixes the stuttering issue, it means the player hands can not be manually be rotated, so when turning your hands in game is not rotated the right way.


4z33cjuwxiay.png
**Edit. Both custom hand left and right are a child of Player.

So at this point I got it to where the hands dont stutter, but the hands are not rotated the right way... trying to rotate them manually does nothing, it just resets its self, and that I think would be due to the code above which I used in the new script I made.

Anonymous
Not applicable
Okay. I just tried out the CustomHands scene in the Sample Framework and I see the stutter that you're talking about. I feel bad saying this in the Oculus forum, but so much of the code in the Sample Framework is broken and out of date.

In OVRGrabber.cs try changing the Awake() function by adding the three lines below:
		// Add this
if (rig == null)
{
rig = OVRManager.instance.GetComponent<OVRCameraRig>();
}
// End add this
The finished function should look something like this (I added some Debug.Log messages so you can see if there are problems):
	protected virtual void Awake()
{
m_anchorOffsetPosition = transform.localPosition;
m_anchorOffsetRotation = transform.localRotation;

// If we are being used with an OVRCameraRig, let it drive input updates, which may come from Update or FixedUpdate.

// FIXME: HEY OCULUS THIS IS A DUMB AND HACKY WAY TO FIND THE OVRCameraRig!!!!!!!
OVRCameraRig rig = null;
if (transform.parent != null && transform.parent.parent != null)
rig = transform.parent.parent.GetComponent<OVRCameraRig>();

// Add this
if (rig == null)
{
Debug.Log("Trying one last time to find the OVRCameraRig.");
rig = OVRManager.instance.GetComponent<OVRCameraRig>();
}
// End add this

if (rig != null)
{
Debug.Log("Success! Found the OVRCameraRig");

rig.UpdatedAnchors += (r) => { OnUpdatedAnchors(); };
operatingWithoutOVRCameraRig = false;
}
else
{
Debug.LogWarning("Couldn't find the OVRCameraRig. There will be hand jitter.");
}
}
  

DemonGamesLab
Protege
This isn't working either : / It essentially does the same thing as the script you said about before. I have contacted Oculus, maybe they can advise on the next step, but at this point I think I'm just going to give up searching, and I might just have to use the Avatar hands again. If I do find an answer, I will post back here, for anyone who has the same issue.

Stacklucker
Explorer
Is there still no solution for this problem? I am experiencing the same stutter/jittery movement problems for my hands, grabbed objects and interestingly enough for any objects that follow the Anchors in OVRCameraRig (more precisely, I have some objects follow my CenterEyeAnchor and they experience the same jittery movement, even though the movement is (supposed to be) smoothed out with the smoothdamp function)

This leads me to believe the problem lies somewhere within the OVRCameraRig...? I am currently using a rift S and have set the time in the physic setting to 1/80 (experienced the same problem before on the rift with 1/90). 

I also noticed one more interesting boolean option in the OVRCameraRig script on the OVRCameraRig game object, called "Use Fixed Updates For Tracking". Well, it does exactly what it sounds like when enabled, but sadly hasn't fixed the problem.

This is strange, since the whole tracking/camera/hand setup I am using is straight from Oculus, I haven't messed with the scripts at all. One more noteworthy thing might be that I am not using the OVRGrabber script since VRTK is doing the grab actions for me.

Sorry for posting in an old thread, I hope I am not violating any rules.

GeoffreyBoy
Explorer
Same stutter movement issue for me. Wishing for a solution.