Afrikaans
Akan
Albanian
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Corsican
Croatian
Czech
Danish
Dutch
Esperanto
Estonian
Ewe
Faroese
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Interlingua
Irish
Italian
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
[MUSIC]
In this video we'll be creating our success levels so
that when the player reaches the very end of your game there is a scene that loads
where they can run around.
Some sort of congratulations, winner, winner chicken dinner.
Click the main menu, that takes you back to the very first screen.
This is our main screen where we've implemented a start button,
where you can start the game and then go through the game.
So it's all just very functional at the moment.
You can make it as pretty and awesome and dressed up as you like, but for
now we just want to get that full complete game flow implemented in our game.
Let's start by making ourselves a start button.
I'm gonna right click, go to UI > Button.
That automatically creates a canvas as well.
I'm just gonna rename this main menu Canvas.
Not critical to do that, but I like to do it just do I know what's going on.
And then button, we are going to rename to start button,that is cool.
And you can see underneath the start button we have some text.
The text we will name start game.
Okay so that's all our naming done,
although I guess that's labeling as opposed to naming.
I'm going to double click the start button itself so it zooms in and
reposition that so it's in the middle of the screen.
You can see when the line goes blue it's in the middle, and hold down alt, so
I'm going to move this a little bit then hold down alt.
So it moves both sides, and drag it down a little bit, okay.
So we've got the button roughly the size that I want to have it,
on top of my game screen there.
I'm gonna have the two windows side by side, so
I can see how it actually looks in my game screen.
Drag this over, you see at the moment that it's not
matching with what we have on the left, with what we have on the right.
This is, as I move my perspective, I move the scaling of my window.
It's making a mess of my button here,
so let's clean that up by clicking on the main menu canvas.
See the canvas scaler here instead of constant pixel size say scale with
screen size.
Now as I move my window around, if we had different resolution and different scaling
and all that kind of good stuff, the button will stay as we want it.
And click on the button, that'll take me down to text.
Click on the button, there we go, I'm gonna move these handles.
Currently it's anchored just generally in the middle.
I'll click on the up, I'm sorry on the top, so
center top you can see it's anchored up the center top now.
What I want to do is anchor it relative to the rest of the screen.
So I need to grab the handles here,
pull that down to the bottom left, pull that to the bottom right.
So I have a handle on each of the corner of my canvas.
That means this will stay relative to screen size, as well.
As we move it around, it's going to stay anchored to its position
on the outside of the screen.
Last tip, click on the Start button.
I'm gonna change the color.
Well, this is probably the second last step, actually.
Make the color a little bit of a yellow.
And then the last step, click on Text.
And change the font size here, make this 50, nice and
big, probably change it to bold.
Plenty of scope in there for you to go and change the font,
maybe do some text mesh pro and make this look a little bit more fancy.
For now that's it.
Good for us.
Actually I told a fib, there's one last last step.
How many last steps are we going to have, Eric?
Well one last last step, which is change the highlight color and press color.
Highlight color will change to kind of an orangey color,
that's when you mouse over it.
And then when it is clicked, we'll change it to a darker,
kind of brownie color here.
So I click play, then mouse over it and we will see what effect that it has.
Mouse over, yep and then click.
And that's doing all the stuff that I want it to do.
And still move my character around independent of that.
You could just have the load next out level exit button down here.
And have the whole thing blank and
let the player figure it out when they come down here.
That would be cool as well, having an exciting way to learn how to.
Exit a level but
for now when it goes through this mechanism of doing stop button.
Okay, what we need to do for our button is give it a script and
with that script we want to load in the next scene.
So I come down to add component.
We'll call this menu, yes, and then create and add that.
Open up Visual Studio.
And this would be a very simple script in here.
I need to make sure we're using the namespace,
unityengine.scenemanagement.
Okay, now we're using that.
Going to remove the start and update functions, we don't need those.
Create our function, which we'll call StartFirstLevel, I think.
StartFirstLevel, and I typed that in first cuz I wanna
take a moment just to point out that we're gonna need to make this public.
So public Void needs to be public so that from our button,
we're in a position to cull this method, so that we can load the next level.
That's why we need to have it public.
And then what do we need to do in here?
Well, we need to say scenemanager.loadscene.
And what scene are we loading?
We'll load scene one.
That looks pretty good.
And we click on our selector here, hit the Scene tab.
And then we're looking for our start button,
which is in the scene, selected the start button.
Now we have the start button, which contains the menu script.
From there we can click on Menu and find Start First Level.
That should be the mechanism for when we click the button,
it will run this method and it will take us to the first level.
Let's see if that actually works, click play.
I ran a little bit, click the button, and
then it loads onto the next level, fantastic.
Okay, so that's the mechanism of creating a start button.
I want to top and tail the game, in other words have something at the front and
end by having a success screen as well.
That's my challenge for
you, create a success level, where we have a final you win screen.
Similar to the start menu but with a you win, and
then some sort of congratulations or well done this is fantastic.
And then a play again button, which will take the player back to the first level.
Or you could have it take them back to the main menu.
And then from there they can go to play.
So maybe I'll do it that way.
At the very end it says, finish or success or well done and
then have that take the player to the main menu.
And as a final step add some flair and share,
do something nifty with your final screen.
When the player wins do something cool and add some fireworks or
the play doing backflips, and share that with us.
And when you've done that I will see you back here.
Okay, let's quickly go through this together,
I'm going to duplicate my main menu, call this success.
Make sure that I've gone up into my build settings up Yonda, where are you?
File, build settings.
And to add Success in here and have it as index number 3.
Cool, that's all good.
We're currently selected on Main Menu.
Jump into Success screen.
And do just a little bit of editing, very quick editing here on the,
Screen itself, just to show it's a little bit different.
So Instead of climbing, we need to click on Foreground, and
then on my tile brush, my rule tile.
I'll get rid of all this stuff at the top here,
make it look like there's some opening that they've reached the end.
And some sort of, yeah, some sort of teasing them ladder,
that kind of goes nowhere, I think might be a little interesting.
Click on the climbing layer, click on the ladder, and then here's a ladder that sort
of just Ambiguously goes up to the top of the screen.
Okay not the greatest of final screen but
one of those things it could be a little bit cool having the player window.
What on earth should I be doing here?
We'll add something more complex as we make the game in more detail,
I think as for what we've got now.
Okay so we've just duplicated all the content over instead of our, where is it?
Instead of our main menu canvas, I'll rename this to finish canvas or success.
Success menu canvas, okay.
And then instead of the button being stop,
I'm going to have this a replay button, I think.
Replay good replay button, and
then the text will need to say replay game, good.
That looks pretty good.
Like I say you can differentiate this a bunch.
For now I'm just going through the role of functionality of it to
make sure it all works.
And then the script is gonna do exactly the same thing.
We need to point it back to the start.
So that's our end screen, if we're on here, loaded on the success menu.
Run around, run around, run around, and then click Replay Game.
It takes us back to the first level, it looks a little bit odd,
cuz I've started my player in the middle of the first level.
But we'd have it start in the proper place in the first level.
If we want to have that go back to the load screen,
then we would change the button.
Instead of it being Replay we would say, main menu, or something along those lines.
Change the button to main menu button,
and then we need to change, make a change for our script in here.
Jumping in the menu, reload, I guess I need to do that, yup.
And then we create another method instead of public void,
start first level, we're going to say Public void,
LoadMainMenu, and that will be a index of zero.
Okay, then back over into our, what's this we're on now.
Main menu button down here.
We need to change out on click, instead of being main menu.
Sorry, first startfirstlevel, it needs to be loadmainmenu, there we go.
We've saved that and
then click play, all going to play, this should take us back to the very start.
Click Main Menu, it takes us back to Start Game.
Start Game, Run through.
Get to the [SOUND].
Okay, that killed me but that's all good.
So we've got our flow worked out now.
That should be enough functionality for you to be able to do your full flow from
Main Menu to Game through all the game scenes.
Back to the end, you win.
Once you have that success,
then you return back to the very start of the screen.
I said adding a little bit of flair or
a little bit of something in there, some text to let them know they actually won.
Let's do that very briefly.
So under my Success main menu, I'm gonna right-click, UI, Text.
And this text box will say something along the lines of,
let's see, winner, winner chicken dinner.
For those of you who are familiar with PUBG, you will know what that's all about.
We'll make this 30, and
we will change the size of that a little bit, go to my t tool here.
Move that, move this.
Little bit bigger, winner winner chicken dinner.
Okay, center that text and I think I will
put a line break in between these two, there we go, winner winner chicken dinner.
Its a little bit light, lets make it white in color.
The color of the text in here white, there we go.
Last step I'm just going to reposition my text to be above the menu and
my menu to be below my text, there we go.
Okay, not super pretty, but is super functional.
There we have our final success screen.
You've also created a main menu screen which has a start button that
launches the game.
That's the full flow and I'll see you in the next video for
some more chunky aspects of getting our game flowing nicely for the player.
See you in there.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.