Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
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
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the last lesson, we created the blueprint for the character and placed it in the world.
However, if we start the game, we are still just controlling this weird flying camera.
We need to tell Unreal Engine which pawn we actually want the player to control, and the best way of
doing that is to use a game mode.
Blueprint A game mode lets us set the default classes to be used for the character, for the controller,
and things like that.
So let's open up the content drawer and go to the blueprints folder.
Right click and create a new blueprint class, and we can actually find this in the comment section.
We have the game mode base.
So this defines like the game being played, the rules the score and things like that.
Right.
So this is exactly what we're looking for.
So we can just click here Game Mode base.
And I'm going to call game underscore action for the action platformer.
We can then double click to open it up, and you can see that this is similar to the character blueprint.
We actually have a viewport here.
We have an event graph.
So we could add some actual logic in here.
And this is something we're going to do later.
But for now we only care about the details panel.
Here you can see all of the default classes.
So we have the session the state the controller.
And these are all things we don't have to worry about.
But we care about the default pawn class.
And now it's just default pawn.
So we can click here and set it to our BP player.
Not the action base but the BP player.
And click here and compile and save.
And this is still not enough right.
Like if I start the game now, it still doesn't let us control the character, because the next step
is that we also need to tell Unreal Engine to actually use this game mode as our default game mode.
We can just go to edit, go to Project Settings, maps and Modes, and here you can see the default
game mode.
So we just have to click here and select our GM underscore action.
And this is enough to first tell Unreal Engine, hey, please use this game mode, and the game mode
will then tell Unreal Engine hey, this is the default pawn, so it kind of goes around multiple corners,
but this is the way it's supposed to be done.
When I click on play now, things are actually different.
I click into the viewport and if I try to move the camera now, I actually can't move it anymore, even
though I was able to do it before.
So this already proves that something has changed, but it's still very hard to tell because we're in
a different position than this character that we placed into the world.
We can press shift and F1 to get control of our mouse back and click on eject.
And if we go away now, we can see that it actually spawned in a new player for us.
So there is if I go back again, you can see here is the player start position.
The game will always use the player start and spawn a new pawn for us here.
So we can actually just select this guy and delete it.
And if I start now and hit on eject, you can see that it spawns our new character and we are actually
possessing it.
However, there is no camera setup in it yet, so that's the reason why we look kind of from a first
person view.
We need to create a camera that looks at the character from the side first.
To add the camera, we need to go back to the blueprint and here blueprints characters not on the action
chart because only the player is supposed to have the camera.
So go into the player and open the BP player.
And you might get this view that doesn't show you the full blueprint.
You can just click here and open full Blueprint editor, and it's going to show you the full view where
we have the viewport, where we have the event graph.
Right.
But we just want to have a look at the viewport now.
And in here we want to add a new spring arm and a camera that is attached to it.
And we want to attach the spring arm to the capsule.
So make sure that you don't have the sprite selected.
Nothing.
Just select the capsule component and click on add.
And here we can then look for spring.
And have the spring arm.
And while the spring arm is selected, click on add again and look for camera.
Right.
So now we have the spring arm which is attached to the capsule, and the camera which is attached to
the spring arm.
And why do we need a spring arm?
Well, it just makes it easier to control the position of the camera.
That's the only reason why.
But now we just look at the character from behind.
So we want to change the rotation of the spring arm.
We can just select the spring arm and we can go into rotate mode here and just uh, drag here on the
blue line on the blue area and drag by -90.
Right.
So on the yaw -90 means we look exactly at the character from the side.
And now we can just drag this over here and start the game.
And you can see that we're actually looking at the player now, which is great.
However, the angle is not that interesting and we're a bit too close so we can go back to the spring
arm.
And first we can change the target arm length to 500 to get a little bit more distance.
And also we can change the angle so we can drag here go up -15.
Well we cannot get -15 here.
So we can change the steps here from 10 to 5.
And now we can go to -15.
And this just gives us more interesting angle.
Let's have a look at it.
Right.
So we can kind of look at the character a little bit from the top.
We get more depth for the scene and this looks a lot better.
But actually the direction of the sun is now a little bit weird.
So we can hit shift and F1 to get the mouse back, eject and look again for our directional light.
Like this.
And we can then drag around here on this axis.
And yeah, again I want to kind of have this angle.
So 250 I can just copy this control C exit out again get the directional light and just control V to
paste it in here again.
And this is going to remember it.
So even if I start the game now you can see that we get the nice lighting that we set up in the beginning.
One more thing related to the spring arm that we want to set up early on is the do collision test setting.
Uh, here on the spring, we can just look for do collision test.
But I want to first show you what this actually does.
So how this works is that if, for example, I can again put in here a add and go to shapes, add a
cube and kind of just put this.
In front of the player and this is going to block the camera.
So if I start the game now, the camera is just shoved into the player.
So the camera is basically the spring arm is going to be pushed towards the player.
If we have do collision test on.
And this can be very nice if you have scenes inside of houses and things like that, but usually during
development, this causes a lot of confusion and actually makes things hard to work with.
So I just want to go here to player and make sure you stop the game.
Go to player spring arm and just remove the check mark from do collision test, compile and save.
And now if I start the game, you can see that it simply ignores the collision here.
And again it kind of depends on what kind of game you want to make.
But usually during development, it's best to just turn this off to avoid any confusion.
And we can then just delete the cube exit out here of the search.
So we now created a camera and we are actually possessing the character.
However, the character still doesn't have any movement, right?
I can hit the arrows on my keyboard, I can hit buttons, but again, the character still doesn't really
know what to do with that.
So that is what we're going to take care of in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.