I’m writing a Escape Room type of game for the Quest (2, 3) and there’s only one small thing left to do: preventing a player from walking out of a room (and into another room or outside the player area).
I’ve got this partly solved already. Whenever a player tries to walk through a wall, he’s teleported back a little - preventing him from actually going through that wall. But a problem arises when he takes of the VR goggles. When he does, the Quest enters stand-by mode. A player can then simply walk outside of a room and when he puts the goggles back on he will be in a place where he is not supposed to be. Reason being of course is that all scripting (and thus all checks) is suspended when the Quest is in stand by.
Now the easiest way would be to enable “Run in Background” in the Player Settings. Unfortunately, that setting is not there in XR projects.
So my thought of solving this, is to detect when the Quest wants to enter stand by mode, save the player’s world coordinates and when the Quest exits stand by mode, teleport the player to these coordinates. I’ve tried using OnApplicationPause/OnApplicationFocus, but neither are fired when the Quest enters stand-by mode.
So my question is: is there another way to detect the Quest going to sleep?