4
\$\begingroup\$

I'm making a game for Kinect in Unity which tracks hand movements. I have the player's root position and the position of their fist stored as 3-dimensional vectors (Vector3 in Unity), but they're both in world space.

How can I determine the location of the player's fist relative to their root position?

\$\endgroup\$
5
\$\begingroup\$

Use Vector3 relativeFistPosition = globalFistPosition - globalRootPosition; to get the fist position relative to the root. Use this new Vector3 for comparing different moves.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.