Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Showcase Head gesture recognition: *nods* yes, *shakes head* no

Discussion in 'VR' started by Kurt-Dekker, Sep 16, 2022.

  1. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    This is a showcase for a quick test I made today to recognize "yes" and "no" head gestures.

    What is the typical developer here using for this kind of input? Is it commonplace in VR these days?



    I haven't tested it in VR yet but if you mount these scripts on a head Transform, it should work just fine.

    Full sources at:

    https://gist.github.com/kurtdekker/0f5f353911d7a064e20868e4e5f4dba4

    It is two scripts, one for yes, one for no, hack it up or twiddle the settings however you like.

    Feel free to blast followups to this thread for any other cool head-motion detection stuff you have used... I'm curious about it all!!
     
    DevDunk likes this.
  2. PepukMan

    PepukMan

    Joined:
    May 15, 2020
    Posts:
    3
    Wow, You did a really cool thing, thank you!
    This is huge time-save for me!
    (In VR (Oculus Quest 2) works perfectly!)
     
    Kurt-Dekker likes this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    You're welcome! Glad it worked.

    I had another thought... you could also do a "Huh?!" reaction by noticing if the player's head tilted to one side (rotated on the Z axis) and held there for perhaps half a second.