October 30, 2018
10.30.18 Unity Play Menu and Changing Scene
Posted by cfitzsim under UncategorizedComments Off on 10.30.18 Unity Play Menu and Changing Scene
I was able to create a Play Menu Scene in Unity. It will display a message “PLAY” on the screen and the play symbol below it. When the user wants to start the game, the user will press on the touchpad on the controller of the headset to switch to the main scene of the game.
- Unity Play Menu
First, I create the scene in the Asset of Unity. In the Hierarchy, I added a Panel to create a background for the scene. In the Inspector of the Panel, in the Rect Transform, I have to adjust the position of the panel. It took me awhile to adjust the position for the background. Â Under Image (Script), I was able to change the color of background and its material as the following:
Next, I added the message “PLAY” and a play symbol into the Panel. I used TextMeshPro-Text for the message and Image for the symbol under UI in Canvas. Same of the the panel, I had to adjust the position of the text and the image to right position, change its color and front under Inspector.
This is the final scene:
2. Changing Scene
The purpose of the play menu is to wait for the user to be ready for the game. The user can point to the play symbol and press on the touchpad of the Headset Controller to change to the main game.
In order to change the scene, I created a C# to implement the process using Unity Scene Manager Library such as
SceneManager.LoadScene
SceneManager.SetActiveScene
After that, I added  an Event Trigger on the Play Symbol on Inspector to switch the scene.
3. Output
I was successfully on changing the scene to the next scene that I wanted, when I pressed not the touchpad. However, Im still not about to active the next scene fully. I will continue to explore and try out different method to implement this output.
Melanie Vu