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
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
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
We can also easily add a death sound to the player when he dies
So are we going to do there is just goes into our player script
Are new player script
Remember we die here
So what we going to do is simply just go ahead and say SFX audio source that play One Show
Death sound
And you can see here we don't have a dead sound yet so I'm just going to go home screen at the top and
Go to our attributes you think that's fine for now
We're going to go ahead in create serializefield skin be a private
Audio clip
Death sound
Go back in the unity here
Guitar player
And you can see now on be good when you play The Script
We have a little better sound here
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
How many got my sound in super can't find
A sound
Does cannabis act on here
Where can I go to
I may be
Can I call
The i2 is the sound of a use for a death
And then save it out
Ok
That's great
Now when we die we also want to make sure that we clear out the inventory rate is actually going to be released
Especially what we're going to do is
Remove the inventory item
When there's
A level loaded
So what I'm going to do is just add a remove
Inventory item
Call to this function here remember this function of the road
This basically just removes inhibitory based on a name
And what I'm going to do is actually just create a new parameter in here and it's going to be a bullying
Remove all
And by the fault that's going to be forced ok
So now I'm going to do is I'm going to say if remove all
Is
Boss
If it's false
Then
Go ahead
And remove a specific inventory
String
Else meaning
If remove all set to true
When was going to remove all in the way you do there is a mandatory dark clear
And I was going to clear the inventory guys have a look at the function remember this is a
Dictionary so what you could type on Google is how do I remove all items
From a dictionary and you'll see that this the first function is recommended to you on Google which is clear
Now we can simplify the Script by the way this don't have to be here are we going to do is put an exclamation mark it for a bit
Going to say if remove all its files
Then
Do a specific clearing
Based on d string
Remove all is set to true then just cleared all
Ok
Lioness we have this other exec here why is that my left because inventory name is not
And neither is remove all I'm just going to do 9
Because it doesn't really matter it right so I just putting on there and then I can say true
So remember guys it's going to clear out or inventory
Using this command here
Because memory called it from mobile
Which is right here
And low-level is being cold
After a death
So we're going to clear out the inventory
Remember clearing out inventory is only clearing out the inventory in the actual
Dictionary which you can be Casey the dictionary right
The way we see the dictionary is by telling unity
How to change order sprite
Based on the dictionary
So when we clear
The dictionary we're also going to tell unity right here
Did you set the sprite
Pretty inventory-2 blank
Does test without you
Almost can I heard the day there we go alright looks like our
Inventory got reset
Our health did not get reset so that we need also make sure we reset our health bar
And the Queens
So looks like we need to use the update UI function
When we go Travel bubble
So many go ahead and do that as well
Update UI
Please simple and then we can also set our coins collected 20
What's it playing test all of this out hopefully everything I reset for us and this reset is going to happen after death but it's also
Can I happen after I get into a new level
0 health 100 health 0 coins no inventory
Perfect
Alright
That you can see dying is pretty immediately 10A hard to know what's going on special in the player just immediately
Snaps back in the position so what we going to do is actually cause a little bit of a pod here
Go into the new player script on a teacher guys how are going to pause and disabled
Players movement
So that we can have some particle effect ok
So what I want to do first is a basically just want to disable the players movement completely
So I want to do is actually just go ahead and good attributes
I'm going to create a private
Bullying
And
Going to be cold frozen
Currently by default going to be false
Then when the player actually dies
So here we go
Where is a frozen
Equal
To the player will be frozen
Upon Tyne
10
When we load into a scene
We're going to say
Frozen = false
But this doesn't actually do anything yet there's nothing that happens when were frozen
We actually could do that
By adding a condition in the update
That sort of wraps
A lot of this actually most of it
Would you put all of it rap
In a simple condition in that if
Frozen
Is false
Can you do an exclamation mark
And then we can put inside of
All of this here
I just pressed highlighter and I just highlighted all of this impressed tab
And then
Close down we want the animators to be even when we are frozen so
We want these animators here to be set regardless of her for frozen on now we won't be able to move
If a frozen
On start let's just set frozen
The true just a test about
What's a play
Alright we can't really move a stock right so why do we want this
Well after death we want the player to freeze for about 2 seconds
Ok
If you can recall
Honoured I function
Frozen a set of true
Put a Miele set of false
Right wing below the level in recording low double here
So nothing's going to happen I'm going to freeze like a split second we don't want that here's what we do
We want you something called yield the oldest basically going to pass a function so it's literally going to just stop
Dysfunction for however long we want
1 set timer is up
Then we're going to move iron to the cells the pseudocode would be something like
Pause this function
Pause or yield
Dysfunction
40 seconds
Freeze the player who's going to stop
Healed
2 seconds
NN load the level
Ok
Sahara we do this
Well you can actually use a yield function
Inside of a typical regular function like this you have to do something special call Dan I immigration
I'm going to Google AI immigration on unity here
And
First thing that pops up is what we need
Scroll down and take a look
Alright
Send me a copy this right here this is the function this is how it's written
Any copy that I'm just paste the right here just for reference so it's going to be a private IP numerator
So we're going to use this word here
Send me a public
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
Enumerated is no void
And
It's going to
Basically use this function here
What's a statin
So here's the functions yield return new
Wait 4 seconds and we're going to wait for 2 seconds right here
Alright so that is
How you writing ienumerator
Public ienumerator died
Where do this stuff immediately which is going to freeze the player and also play a death sound
And also going to
Wait for 2 seconds
NN loader level
It so this should work the only thing that's not going to happen as the players that could disappear right
You just going to stay in there but I wait 2 seconds
And is going to die
And then he's going to reset
What's like it's not working why is that so where is this die
Function being called
Well if you got to the new player here you can see we have died
What the way that we actually call this when you're using
And I remember is need to type start
Protein
It's a little weird I know trust me
Sometimes I have to look this stuff up and I always have to look up and I numerator Communities web
Just to make sure I'm writing all this out correctly and if you guys are confused just double check your look
That's where this
Protein is being cold in its right here
Alright so we're going to start the curry teen died
And it's going to
Fire this function here
And it's going to include this yield and it's gonna wait for 2 seconds
Alright
Play
There we go
Alright
Next week when I deactivate the player when he died so that we don't see anything after he dies but we
And then load the scene
The problem with that is a weedy activate the player we also deactivate the new player Script so all of this
Does even happen right
When I get a load allowances going to deactivate player
Scripts stop running when you deactivate a game object
So what I'm going to do is actually take a look at my player here and I basically want to disable all of this stuff here
So how do we fix this what can we do
I don't want to just go through every single thing here that's going to be kind of ridiculous I don't want to say something like that
Deactivate I'm right the activate bicep left bicep right there's going to be ridiculous in a script
So what I can do
Is actually just go ahead
Create a new animation
South Croydon new clip
Minion animation
Then go go to characters player
And I'm going to say player
Die
Quick record
How to disable
All of
Are sprouts
Just disable the spray render when I get to deactivate the game and liquids going to disable spray rendering just like that
Energy can recall player stand
We want to make sure that
They get activated on player stand
Ok
Because once we go back to play a stand and want to make sure that
Renderers are enabled again
So now it's good to hear I am here and you can see we have
That new
Animation
So we can actually
Just Dragon Tattoo here
And on any state we're going to make a transition
There's going to be no exit time instead train station there's going to be a condition
And I condition is
If the bullying
Dead
Is that a true
Conditions if
Dead is that a true
Just got a player died
If not we're gonna go right back to stand
So if dead
Set to false
When I go have any extra time no transition-duration zero
It's going to go right back to play a stand
Ok
So one final thing we need to do here's just go back to a script
And you guessed it we're going to go animator
Dead and we're going to send it to
And then when we loved her level we just need to make sure we said that right back
The boss
Why are we using an animation guys well for two reasons again
We don't want to have to disable all of these with the Script technically we could put these inside of a parent object inside
But I don't really want to do that I want to mess up my player and also hey we can also create some cool in a
If you really wanted to we can have him collapsed to the ground we can have you know him Flash and then
Is B arts good slowly disintegrating I know we could do a lot of staff
What's go ahead in tested and see if it works
Perfect
Mario's alright
So let's just go ahead and make it look a little bit prettier remember we have the particles for
Is enemies here that's open up those enemy's enemy
Explosion remember that
But we just go ahead and use that for the player as well that's another player
And adding
Does particles
Also just gonna duplicate
Particle enemy explosion pressure control die
My holidays particle
Player
Explosion
Technically we could use the particle anime explosion by I like to prepare for the future the future might me
Set the player changes colours in so I might want to change this colour and I don't want any silly change the player enemy colour
And then other settings as well for for the player explosion so I like to keep it separate
Ego
I'm gonna put that right here just in the centre of his chest so something like
This
Alright
And what I'm going to do is I'm going to have this be a little bit more than the player what I'm going to do it
What does 0
That means we can keep this enabled at all times we don't have to disable or deactivate
This player explosion
All we need to do is just omit some particles remember using the animator function script
So we are going to play a bearing in a pier and you can see we have
The animator functions
Now we need to create a few more particles so right now we've only got four particle systems allowed to be
He made it without any better functions some of the major functions here just add one more
Copy paste
Unit particles 5
Particle system five in image
That those don't exist when you destroy the top here in add those two
My girl
Hi let's jump into the new player script
And we can either add that event to the animation timeline when the player dies or we can just add it to the
I'm here I'm just going to go ahead and add it here animator functions
He made particles five and I just close it out
Now it's tested and see how it works looks great
Finger prime make it a little bit more particles so we can just go to the player here and that's
About
50
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.