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
Now that the respawn at the checkpoints are working, you want to make sure that this also works.
If we fall off the stage.
If we just walk all the way to the right side now and fall down, nothing happens.
We just keep on falling forever and ever and we need to implement a volume for that.
That checks if the player falls down and then lets us respawn as well.
There is actually already a system in Unreal Engine for this built in, and if you go to World settings,
if you don't have world settings, you might have to click on window and open the world settings.
Here you can see that there is a kill Z volume.
And if let's say we put this to -100.
I can then go over here and do the same thing.
And now I fall down.
The character is being destroyed.
The problem with this system, though, is it doesn't give us control over anything.
We don't get an event, we get nothing.
The character is just gone.
But that isn't what we want.
We still want to have our entire thing with the screen fade and spawning the new character.
Right?
So this system is not good for this purpose.
So just set it back to a really, really high number to make sure it doesn't take effect.
Go to the content, draw to blueprints and props and here it is.
Right click and create a new blueprint class.
And this is also a basic actor because it's going to be a very simple blueprint.
And it's called BP underscore fall detector.
Then open it up.
And in here, all we need is a box collision that checks for the player.
And if the player falls in, we either just set it to defeat it or we apply damage.
So here we can just add and we can look for box collision.
Like this and we can just call trigger to make it more obvious what this is being used for.
And then on the right side, if it's selected, go to the collision settings.
And again we just want to set this to custom.
Ignore everything and only check for the overlap with the pawn.
Then we want to go to the on component Begin overlap event.
Add this in.
And as we've done a couple of times now, other actors cast to be player.
So this only activates if the player is the one who is falling in here and here.
We can then simply call apply damage.
Apply damage to the player as the damaged actor.
The damage causer should be ourself so we can just drag off here self which is the trigger volume.
And then for the damage we can just put something really high just to make sure that the player is going
to be defeated anyway.
And this is just kind of a trick that many games use to have a shortcut.
You don't have to make a custom system just to apply damage through a fall detector.
And we can then just compile and save.
And we want to drag it into the map.
So here on the right side we just want to go here, drag in a fall detector.
And we want to make it bigger.
So not the actor itself but on the fall detector.
Right.
We can go to details.
And here we have our trigger.
And for the trigger box you can see the box extend here.
And we can just drag.
And you see it becomes bigger and also drag in this direction.
And also a little bit like this.
And now we can just place this somewhere in the world where you want to use it.
Like this and make sure it kind of lines up with where the player is going to walk down.
And you could make this so big that it covers the entire stage.
That would be a good safety net, but we're going to use it more selectively.
And let's try this out now.
And I can go here.
I can walk to the right side.
And you can see we fall down, we apply damage, we kind of get bounced off and then the screen fades
out.
You might not like the bounce off animation, but actually think it looks kind of cool in this case
as well.
It doesn't make sense logically, but it again is more readable.
It makes it very clear that we died, and later on we're not going to use this just on a hole.
We're actually going to use this on lava.
So it's going to start making more sense then as well.
But you could make a special override to, let's say, if you use the fall detector to not play the
knockback, but I like it, so I'll keep it in.
And this is all there is to the fall detector and detecting if an enemy steps into lava or falls down
a hole.
In the next video, we're going to create our first enemy AI.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.