,How do you make a vr pause menu?
Hello whoever is kind enough to read this. I have recently been working on a vr game for steam vr, using the XR interaction toolkit. I would like to know how to make a canvas that appears when you press the "pause" button, and disappears when you press it again. I would also like to know how to make the worldspace menu appear in front of you.
A good example of what I am talking about is the pause button and menu from Beatsaber. I do not know how to refer to the button as I do not know its name.
Sorry about my poor explanation. Thank you to anyone who can help!,Hello whoever is kind enough to read this. I have recently been working on a vr game for steam vr, using the XR interaction toolkit. I would like to know how to make a canvas that appears when you press the "pause" button, and disappears when you press it again. I would also like to know how to make the worldspace menu appear in front of you.
A good example of what I am talking about is the pause button and menu from Beatsaber. I do not know how to refer to the button as I do not know its name.
Sorry about my poor explanation. Thank you to anyone who can help!
Answer by rh_galaxy · Mar 02, 2021 at 12:46 PM
To make the game pause you could use Time.timeScale = 0.0f; And you should also cancel any input to the game.
To display a menu in front of where the player looks you could use this code.
Vector3 vHeadPos = Camera.main.transform.position;
Vector3 vGazeDir = Camera.main.transform.forward;
menuContainer.transform.position = (vHeadPos + vGazeDir * 3.0f) + new Vector3(0.0f, -.40f, 0.0f);
Vector3 vRot = Camera.main.transform.eulerAngles; vRot.z = 0;
menuContainer.transform.eulerAngles = vRot;
Your answer
Follow this Question
Related Questions
Problem UI masking in google vr 2020, unity 2020 0 Answers
Display VR UI in front of Player Camera and follow player facing direction 1 Answer
How to change/fix Shader Graph node connection ports 3 Answers
Generic UI interaction for VR 0 Answers
Unity Canvas Grid Layout - Keep cells perfect squares and fit in parent 0 Answers