Forum Discussion
kburke
11 years agoHonored Guest
Listening for health & safety button keypress?
Okay, this may be a dumb question. Say I want to present a dialog that says "Face forward and press any key when you are comfortable" or some kind of similar recenter dialog.
If I write something like the following:
When the user presses a button to dismiss the health and safety warning, the second branch will also get triggered, incorrectly. I believe that the health and safety warning also goes away after some amount of time (even with no keypress). How should I code for this? Is there a variable or setting that detects the presence of the warning?
If I write something like the following:
void Update() {
if (state == STATE_INIT) {
drawRecenterDialog();
state = STATE_RECENTER;
} else if (state == STATE_RECENTER && Input.anyKeyDown) {
// record user's default position and start the application
}
}When the user presses a button to dismiss the health and safety warning, the second branch will also get triggered, incorrectly. I believe that the health and safety warning also goes away after some amount of time (even with no keypress). How should I code for this? Is there a variable or setting that detects the presence of the warning?
3 Replies
- cyberealityGrand ChampionWhat engine are you using?
I believe in Unity you can check if the HSW is being shown, and then add your recenter code if it's not. - kburkeHonored GuestAha, thanks for your help!!
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
- 1 year ago
- 1 year ago