Forum Discussion
Anonymous
4 years agoHow to detect when guardian changes from Unity?
Hi,
I'm developing a roomscale game and I use OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary) to create a custom in-game visible boundary so that the player can align their playspace to the in-game playspace as they like. As part of this process they may decide to update their guardian, but then the geometry I previously fetched is out of date. One way to solve this would be to have an in-game way for the player to reset the in-game boundary and I would then just refetch the boundary. However, I'd prefer to automatically detect any change. I can't for the life of me find an efficient way to do this or any events.
My other thought is to just re-fetch and re-build the in-game boundary every couple of seconds but that also feels a bit lame 🙂
Help!
- Anonymous4 years ago
To adjust the guardian the running application has to lose input focus. I think you could just verify the boundary every time the application gains input focus?
public class FocusTest : MonoBehaviour { private void Awake() { OVRManager.InputFocusAcquired += OnInputFocusAcquired; } private void OnDestroy() { OVRManager.InputFocusAcquired -= OnInputFocusAcquired; } private void OnInputFocusAcquired() { Debug.Log("Verify boundary."); } private void OnApplicationFocus(bool hasFocus) { if (hasFocus) { Debug.Log("This might work too."); } } }
2 Replies
Replies have been turned off for this discussion
- Anonymous
To adjust the guardian the running application has to lose input focus. I think you could just verify the boundary every time the application gains input focus?
public class FocusTest : MonoBehaviour { private void Awake() { OVRManager.InputFocusAcquired += OnInputFocusAcquired; } private void OnDestroy() { OVRManager.InputFocusAcquired -= OnInputFocusAcquired; } private void OnInputFocusAcquired() { Debug.Log("Verify boundary."); } private void OnApplicationFocus(bool hasFocus) { if (hasFocus) { Debug.Log("This might work too."); } } }- Anonymous
Thank you so much! I'm pretty new to all of this and that's a wonderful solution. You totally made my day, thanks!! 🙂
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 27 days ago
- 7 months ago
- 1 year ago