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
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
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
Of course our
Survivors Style game here would not be complete without the ability to up
Radio various skill
And we are getting there
We'll get there
Very soon
What does
Will bit more foundational work we need to do before we can actually start
Creating a cyst
And the foundational work that we need to do is to actually transfer
Damage
From the ability
2
The enemy
So if I pull out the basic enemy
The problem here is if I open the Script
Where does cooling health component damage 100
This number needs to be
Determined by the skill that hits the end
And you can see that we need to implement a system for that before we can start doing things
Skill up
So how are we going to transfer the damage let's take a look at the flow of our
Game again so let's go to the player
Scene control shift open the player
Subtitled by online-courses.club We compress knowledge for you!
And you can see that we have the sword ability controller
Install the sword ability controller is responsible for
Creating the sword
That then
Will attack the enemy
And so if we look at the sort of Billy
So we open that seem up
Are the sword doesn't actually have a script at all
But the area 2D gets enabled by the animation player
Which enables any
Is to collide
So we have a couple of layers that we need a past damage down from
So the damage alternately needs to come from the sword ability controls
And the reason is because you can imagine
Will want to do upgrades for the sort of building control
And
It will
Take close-up
Chequers upgrades and it will pass those upgrades to the sword
When it's fine
And the way that we are going to tackle this is we're going to create a couple of new components were going to create
Hitbox component
Andy hurt
So let's go ahead and start with the hurtbox component so let's go to our basic anime scene control
How to open up your
And in this basic any we have this area
Let's do this
Let's rename the area2d by clicking into it
And then we're going to call it hurt
Box company
And then let's right click on that note that her box jump on it
Click save branch as seen
Can I go into scenes
Component and we're going to save it alongside our other compare
Ok
Now before we work on
Let's go to our
Sword ability
This area2d right here
We need to take the sword abilities area2d and rename this to hit
Compound
And then we're going to save and we're going to do the same thing we're going to right click the hit box company
Save branch
Scene
We're going to save it alongside our other
Ok
So where the heart box which is going to represent the area of an entity that can
Kit
Buy a hip-hop scum
In the hit box to buy
Is going to be the thing that confers the damage
What is the thing that is attack
The hurt
So it's even play
We have to do one more thing which is that let's click into the head box component
By going into the sea
Let's select the collision shape 2D
Unless
Cut it with ctrl x
Never gonna go back to your sword ability
Highlighter hitbox component and then press ctrl V
Does save our hitbox component so save that
And then we can we name our collision shape to
And are animation should still be working so if you put the animation you should so see a turning blue for a little bit when you play it
Again you'll have to save the hip-hop dance
First after you remove the closing share
And then rename is closing shape 2D
Collision shape 2
To do the same thing in our enemy so
We are going to go into the hot box component were going to cut this collision shape from the herb box component with
Save that scene
Go back over to a basic enemy
Over the hurt box and press control
And the reason why we did that is because we separated the collision shape definition from the compare
Itself
So now if we were to instantiate for instance by right click
Airbus component
We can supply a different shape
So not locked into the show
When we reuse
Component across
The game
So the bulk of our work is going to be done in
Hitbox compose
So let's go ahead and add a script to the hitbox compound
The default settings are fine like usual
And the main thing I want to do here is first we're going to give it a class name so as to class name
Hitbox
Company
Ok and then let's create a variable call
Damage Emma going to set it to 0 by 2
And I'm going to go to our sort of Billy
What we're going to do with the sword ability
Is we are going to add a
To this
Sorbillo
So what's going on at the
Just like normal
We're gonna add class name
Sword ability to this
And we're going to do
Add on read
Via
Hitbox component
I'm going to type it as the hip
This is why using the class name so we can type 2
Is equal to dollar sign
Pit bikes compare
And then we have to go to the other layer which is the sword ability controller so let's do control
How to quick open
Sword ability controller is the one we want to open to go and search for
Open app
We already have a script here and sort to make a couple of minor chair
So firstly we do want to have a damage variable in here as
So let's Create
Variable below the x
Van Damme
0
Actually want to set this damage to something like
+254 now
Because our enemies well by the fault have it
Tenzo this wall
2 hits
Secure
Are basic enemy so Saturday
And then on timer timer
Let's look for where we are doing the sword instance
So here where is Dan shooting the sword
Let's Castle instead as a sword
Ability
And what that's going to do for us now
Is that after we add a sword instance to the
Players pair
We can assign the damage
And so
What I'm going to do is I'm going to say
Sword instant star
Hitbox compound
Dad
Damage
Is equal to
So you can see why we set up a script for
All this right
So we still have a sword ability and we cast to the sword bill
Why because we have hitbox component variable that we can
I'm referencing and hitbox composed
And I'm assigning the Dam
So if I go to
Hitbox component in here
We've got a diamond
So that's one piece of the puzzle so we've got her damaged flowing from our sword ability controller
2 hour
Sword ultimately
Now in our basic enemy
We want to click into the heart box component so let's open up that her box components seen
From the basic enemy or you can open it by doing the quick search
What's attach a script to this work
And the default path is ok
Again let's do a class name for this
Class underscore name
Hurt back
Composed
I think you're going to do here
We're going to export so at x
2 x 4
Bar
Hello
Underscore component
And I should note that I believe you're supposed to be able to do something
Play Converse
Export via health component health compound
However you can see in my version of video that I'm using
I cannot select that help component there
So
That's ok I'm just going to you
Playing all night here
Anyway we've got we're going to get a reference to
Health component now in the
Herb box component
Animal we can do is weekend override the ready method so funk
Score Reading
And then we can say
Ariel Winter
Because this is a signal on area2d in work standing area
Dart
Connect
On
Area
So let's go ahead into fine
Funk
On area and
And the other area
Is going to be of type area2d
And we're going to do this
Other
Underscore error
I actually want to say if not
Are there area
Is
Hitbox component
Then what we want to do
Is we want to just return
Ok so now we can grab the other area
As a
Pit bikes compare
So we can do with our hitbox component is he go to other area as
Skip
Component and now what we can do
Is we can take the damage from the hip
Check in here as well and we're going to same
If
Health
Component
Is equal to now
Organ to return out of this as well
Ok
So now we've got those safety checks in place
Now we're dealing with a collision that came from a hitbox component remember the hitbox component is of
Area2d as well and so that's why this is going away
And all we can do is we can take it the health component
Dot damage
And when I going to get the autocomplete because
This
Is believed by kaido to be a type of nose
But we can pull up our
Subtitled by online-courses.club We compress knowledge for you!
Health component
And open up that script and we can see
That we have a damage function so will still be all the call it despite the fact I could do is not giving us the autocomplete suggestion
So how's component damage and we're going to grab the damage of the hitbox component
Just like that
So now we have closed
The damage has been
From the sword ability controllers
Define here
It's been past
In the other sword instance hitbox compound
Were signing the damage here
On the box component
So that looks like
This
So we've got our hitbox component here
As a reference so that we can set the date
When a hip-hop component collides with h
Letterbox component which I will open now with ctrl shift l
We're going to check first of all if the area coming into our her box is
A type of hitbox component if it is
And we have a reference to the health component
They were going to go ahead into your Devon
And so now what we should see is that the enemies will not die instantly because we doing 5 damage
Hit them
Instead it should take two hits and
Let's go out and see if that
And we got a crash
And that's because I failed to update
My basic enemy script
This is going to be
Pretty easy we just need to actually tear out
This
So we got a basic anime
When I using the herb box component to handle the damage
An equation
So we actually don't need a handle
Any of this in the basic enemy
So go ahead and open up your basic enemies
By clicking the Script button we can get rid of the ready method
I'm also going to go ahead and get rid of this comment while I'm here
And we can get rid of this on area entered
And so we should be good to go now so I'm going to go ahead and
Run the game in actually there is one more thing we need to do
We need to set up
In her back support the basic anyway we need to put the health component referencing
So so like The Hurt Locker part drag the health component in
And now everything should be
Let's go home
So we should be two hits on
1
And they're gone so we have damaged so if your enemies are dying in two hits and you can figure it out the damage the same as me
Then you should see this behaviour
Exactly
So now we have a proper Foundation
For handling
Ability upgrades
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.