Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

How to Check if OVR player has rotated 360 degrees from start

Discussion in 'AR/VR (XR) Discussion' started by ClaudiaKrog, Jun 23, 2020.

  1. ClaudiaKrog


    Sep 30, 2017

    I would like to check if my player has fully turned 360 degrees from her starting position when the Unity game starts. This has been tricky, since the user can start at any angle (360, 20, 0, 45, etc), and I do not know which direction she may turn. Additionally, she may turn 90 deg to the right and then 270 to the left, but this does not constitute 360 degrees in one direction.

    I have tried many different ways of doing this, but cannot think of a way that will work. If this were an object that just rotated once, I know I could check to see if it returned to the starting position. However, since this a user and I don't know how she will behave, I am not sure how to do this feasibly. I can get the rotation of the center eye in many different ways. Is there a way to just get the difference in rotation, rather than the actual rotation? For example, if user starts at 30 degrees, and goes 20 degrees in some way, how could I get this 20, rather than either the 10 of one direction, or the 50 in the other direction? If I could get just the rotation difference, I wonder if this might work, with setting the starting rotation at zero as well.

    Any ideas are appreciated! Thanks.