How would I go and make a 3D or 2D object follow my hands using the hand tracker?
I tried using both the real and proj positions received from the handtracker. De proj positions which are between 0 and 1 are very odd and don’t seem to work right. The real positions work but not if you change your real life Z position. So walking closer or further away from the camera.
I’m using this code:
Vector3 transformPosition2 = new Vector3(handCoupleData.RightHand.RealPosition.x,handCoupleData.RightHand.RealPosition.y, 200f);
Vector3 cubeWorldPos = Camera.main.WorldToScreenPoint(transformPosition2);
_manager.RightCube.gameObject.transform.position = transformPosition2;
I’m using my own class (handcoupledata) for the data but it returns the exact same data as the one received from unity since I just put it into my own class in the update event for hands. So that’s correct.
We only want to move the object on the X & Y. The Z needs to be fixed. We also tried converting the proj position to world, and the real position to screen. Any help? We used the RGB camera tutorial to visualize the camera on screen, so we can check if they’re actually on the hands position.