Search Unity

Do anyone know a way I can get the players body rotation data for vr?

Discussion in 'Scripting' started by shadow15919, Apr 8, 2021.

  1. shadow15919

    shadow15919

    Joined:
    Apr 2, 2021
    Posts:
    4
    I am using the oculus integration assets and was wondering how I can get the players body rotation and not the rotation of the user head. Im not sure how to do this. I just want the script to print out the rotation data whenever the user rotate their body in game in vr using the quest 2 controller. Any help would be greatly appreciated.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Oculus doesn't have sensors on the body, so it doesn't have that information. You'd have to estimate it by taking into account the hand positions and head rotation. (It's possible the Oculus API might have something that does this estimation for you, I don't know the API well enough to say, but I can pretty confidently say that Oculus does not "know" your body position.)
     
    shadow15919 likes this.
  3. shadow15919

    shadow15919

    Joined:
    Apr 2, 2021
    Posts:
    4
    Oh, I meant the in game body rotation and not the rotation data of a person real body.
    I figure it out.
     
    Last edited: Apr 10, 2021