Showing results for 
Search instead for 
Did you mean: 

Event or Callback for player exiting Guardian

Level 3

Hello!  I'm looking for an event or callback for when the player exits (or re-enters) the Guardian.  I can't seem to find anything relevant in the documentation reference.


In my game, the player configures the in-game environment to their guardian.  When the player exits the Guardian accidentally and then re-enters, the in-game environment doesn't align with their guardian anymore.  I need to tell them to redo the alignment.


It did occur to me that I could use OVRBoundary.TestPoint and test against my user's head, but I'm not excited about manually polling that every frame *and* I don't want to worry about false negatives.


Level 3

*edit*  Just kidding, OVRManager.AllowRecenter does not do what I'd hoped, and now I have no idea what it's supposed to do.  I'll be exploring OVRPlugin.GetLocalTrackingSpaceRecenterCount next.



It happens that I was able to solve this issue for my game by setting OVRManager.AllowRecenter to FALSE.  Setting it to TRUE causes the game to attempt to realign to the player after re-entering the guardian, but I didn't want that.  By setting it to FALSE, when the player walks around outside the guardian and re-enters, they're exactly where they should be.

I believe you could use OVRPlugin.GetLocalTrackingSpaceRecenterCount to create an event or callback in the way I originally hoped, but I didn't get around to testing it.  That path is left as an exercise to the reader.

Level 3

I found that OVRManager.display.RecenteredPose will generate a callback for exactly the situation I need, BUT, it also generates a callback when the player manually resets their view, which isn't ideal for my purposes.

I also tried monitoring OVRPlugin.GetLocalTrackingSpaceRecenterCount() but that seems to also increment when the player manually resets the view.

Level 6

I think another user was trying something similar recently and they got the results they desired by switching "Tracking Origin Type" to "Stage" in the OVRManager.