Software Archive
Read-only legacy content
17061 Discussions

Unity tip for dealing with mis-rotation when the hand is moved sideward

MartyG
Honored Contributor III
682 Views

Hi everyone,

I thought I would pass on a simple trick I discovered for dealing with the dreaded phenomenon of what I call "sidewards mis-rotation".  This is when you have configured an object to move up and down when a face or hand gesture is detected, but the object also moves when you move your real-life hand sidewards.

However, if you put a value of at least '50' into the Real World Box Dimensions section of the TrackingAction script in the directional axis that you want your object to move in, and have the other two axes set at '0', then the object will simply twitch a bit when you move the hand sidewards, whereas you will be able to move the object just fine in the direction that you intended it to go in.

You can reduce the twitch even further if you use larger values in the Real World Box axis such as '100' and '1000'.  The trade-off is that the larger the value used to minimize twitching, the less distance your object will be able to travel in its intended direction when you move your hand within the camera's vision range.

If you want to move an object that needs anti-rotation measures using the same hand or face control as you are already using for something else then you can set the control to be triggered only when a specific gesture is made.

I tried this with both hand-tracking and face-tracking settings and it worked for both.  I personally recommend hand tracking though, as it is less sensitive than the facial detection and so the twitch is considerably less.

In the example in the link below, I used the TrackingAction script to set a basic cube to be largely immune to moving when the hand is moved sideward.  Settings for gestureless movement ('always true') and gesture-triggered movement are shown.  As I have constrained the cube in the 'TrackingAction' to only be able to move in the vertical 'Y' direction, I have placed my Real World Box anti-rotation setting in its 'Y' axis box.

http://sambiglyon.org/sites/default/files/anti-rotation.jpg

Good luck!

 

0 Kudos
2 Replies
Serhiy_Posokhin
Beginner
682 Views

Thank you Marty!

0 Kudos
MartyG
Honored Contributor III
682 Views

Thanks Sirhiy!

I found that you can get similar anti-rotation results from face-driven objects if you considerably amp up the Real World Box value to take account of the facial tracking's higher sensitivity.  For example, to get stability from an eyelid-tracking object that was comparable to using the technique with a hand-driven object, I had to increase the value from '50' to '200.'

0 Kudos
Reply