Update Ray Based On Object Oritentation

I’m running into an issue when working with the Oculus and Leap Motion.

Basically what I’m trying to do is draw a test debug ray from the palm of the left hand out using its upward vector direction at all times. I used the following code for it:

	// Update is called once per frame
	void Update () {

        // check from the hand and raycast out
        HandModel leftHand = handStateDetector.leftHand;// access the left hand
        if(leftHand)//if the left hand is on screen...
            Vector3 leftHandPalm = leftHand.GetPalmPosition();
            Debug.DrawRay(leftHandPalm, transform.up); // up vector does not update with the hand rotation

The issue is that the transform.up parameter is using the oculus headset’s orientation as the basis (which is a parent object to the left hand object) as opposed to the left hand itself. I did alternatively try using Vector3.up instead but this just meant that the ray always drew in the same direction irrespective of hand orientation. Would anyone have any solutions I could try to get around this?


Thanks for the help there. I managed to actually get it working instead using GetPalmNormal, so all is well now :3.