Last time, we’ve learned how to move to other scene, and made start butt0n.
First, I downloaded the script here.
Now go to unity, create a new project.
After making a new project, we will make 3 scene.
And create a new folder named ‘scenes’, and drag three scenes to that folder.
And also make scripts folder, and bring those scripts there.
Now let’s create a terrain and move your main camera’s location.
Then we’ll create a ‘text’. Go to GameObject > UI > Text.
You can change the font, and transform its size.
If you select overflow in Horizontal and Vertical Overflow, your font can get bigger whatever you want.
Now we will add a background music. Create a audio folder, and I downloaded a music in asset store. In Gameobject, click Create empty. And change its name ‘audio’.
Inside audio’s inspector, add a component ‘audio source’.
And choose the music you want, and check ‘Loop’.
Next, we will make a start button. Create UI > button.
Make a start button, and customize yourself.
You can make button transparent. Write ‘0’ in alpha.
Now we will add a script.
If you double click the loadonclick.cs script, you’ll see this.
Now drag the loadonclick.cs script to the ‘canvas’ inspector.
Go to Button inspector, you can find ‘On Click ()’. Select Canvas, and choose LoadScene function.
If we click the start button, player goes to the scene1.
Next, we’ll import a character package. Uncheck roller and third person, and import.
Now save the startscene, and go to the scene 1.
Delete the main camera, and bring ‘fps controller’ into your scene.
Create a terrain, and make a cube. Add a box collider in cube. Check trigger.
And you have to select the tag ‘player’.
Change the color of light. And test whether you can walk around.
Now make it same in scene2. When we collide with scene1’s cube, player will go to the scene2. Drag a move code into the scene1’s cube, and write scene2.
Now I can move around scene1 and 2 freely.
I made a start scene in my maze, but I clicked start button, but it doesn’t move on T.T..
I don’t know the reason, I will ask professor on next class.