Skip to main content
Participant
December 31, 2016

Debug position of touch child objects not matching "real" position

This is difficult to describe but easy to see.

Basically, I have some "hands" controlled by touch using OVRInput.GetLocalControllerPosition/Rotation, one of which has a sword child object. On the tip of the sword object is another child object, which I've added a sphere mesh to to demonstrate the issue.



I intend to use this object's position to cast a ray, but when I use Debug.DrawRay(transform.position, transform.forward, Color.red) in a script attached to the object, you can see the results are nowhere near where the actual object is (which is getting rendered in its correct position).

I'm a bit stumped here. Anyone have any idea whats going on here?
This topic has been closed for replies.

1 reply

Inspiring
January 2, 2017
OVRInput.GetLocalControllerPosition/Rotation reports poses in tracking space, not world space. Debug.DrawRay should work properly if you use OVRCameraRig.leftHandAnchor.position/rotation instead of calling the above OVRInput functions.