cancel
Showing results for 
Search instead for 
Did you mean: 

How to move Player in Hand tracking

modhdhruv
Explorer
How to do the movement of a player while using hand tracking in the oculus quest? Anyone have done Player movement?
Have tried to move OVRCameraRig with joystick four-button forward/backward/left/right. OVRCameraRig moves perfectly but issue is both HAND Models are not moving with OVRCameraRig. 
Tried to Put "Hands" game object as a parent of OVRCameraRig but no luck
Does anyone have an idea?
19 REPLIES 19

TomG
Explorer
Same issue here.. the moment you move the OVRCameraRig away from 0,0,0 the hands stay at the original location. It's pre-release, but still, seems like that should not be that hard to fix. I'll have a look

TomG
Explorer
Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();

xiesi
Honored Guest

TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();



It's not working properly. Can you help me solve this problem again?Thanks

TomG
Explorer

xiesi said:


TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();



It's not working properly. Can you help me solve this problem again?Thanks


What's not working.. please be a bit more specific. I found some issues when you're starting outside of 0,0,0 but if you start there you can transport elsewhere and still have your hands working.

video of the result:
photos.app.goo.gl/EH6Di834PsYH3WgH9

xiesi
Honored Guest

TomG said:


xiesi said:


TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();



It's not working properly. Can you help me solve this problem again?Thanks


What's not working.. please be a bit more specific. I found some issues when you're starting outside of 0,0,0 but if you start there you can transport elsewhere and still have your hands working.

video of the result:
photos.app.goo.gl/EH6Di834PsYH3WgH9


The hand can be used normally. It can move to a position other than 0,0,0, but the position of the ray does not follow the position of the hand.The ray is still emitted from 0,0,0.

stefaneisele
Explorer

Don't know if this solution is the
best, but it works.
Add this code to the RayTool.cs code to
get the HandsAnchors inside the class:


public GameObject handAnchorLeft,
handAnchorRight;
public void Awake()
        {
           
handAnchorLeft = GameObject.Find("LeftHandAnchor");
           
handAnchorRight = GameObject.Find("RightControllerAnchor");
        }


As well change the GetRayCastOrigin()
function inside the RayTool.cs like in the following lines:



private Vector3 GetRayCastOrigin(){
     if (IsRightHandedTool)
     {return
handAnchorRight.transform.position + MINIMUM_RAY_CAST_DISTANCE *
                 handAnchorRight.transform.forward;}
     else
    {return
handAnchorLeft.transform.position + MINIMUM_RAY_CAST_DISTANCE *

                 handAnchorLeft.transform.forward;}
}


In the script RayToolView.cs go to the
Update() function and change "var myPosition =" to:



var myPosition =
InteractableTool.IsRightHandedTool ?
transform.parent.GetComponent<RayTool>().handAnchorRight.transform.position
:
transform.parent.GetComponent<RayTool>().handAnchorLeft.transform.position;


This should do the work. The rays are
now following the positions of the hands if you move the character.

modhdhruv
Explorer
I'm trying to move OVRCameraRig forward/back/left/right using hand button interaction. The issue is when OVRCameraRig moves forward, Hands do not move with OVRCameraRig. Does anyone have solution for this?

modhdhruv
Explorer

TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();



Try to change position in HandSkeleton.cs. But not working.

Stimmits
Explorer

TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();




Ah amazing, this worked. I also had to change the rotation to use the localRotation. Thank you very much!


modhdhruv said:


TomG said:

Look for the file: HandSkeleton.cs, change line 145 to use localPosition

// line 145: transform.position = pose.RootPose.Position.FromFlippedZVector3f();
transform.localPosition = pose.RootPose.Position.FromFlippedZVector3f();



Try to change position in HandSkeleton.cs. But not working.



This only works when you have the skeleton hands active, for the mesh hands change HandMesh.cs to the following:
// line 119:
vertices = transform.InverseTransformPoint(mesh.VertexPositions.FromFlippedZVector3f());

Also, make sure that your hands are parented under the OVRCameraRig.