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
In this video, we're going to have in a few more characters, and then we're going to have a damage
system for our player.
OK, so at the moment, we only have two of each character.
So what they want is effectively a total of four of each characters.
That gives us a total of 12.
All right.
So and the first thing I'm going to do is create a new empty game object, know, simply call this animes.
That way we can keep them all together.
OK, I'll just zero out the position.
I always like to do that.
And then we're going to take all of our enemies, put them in their.
And then furthermore, inside of our enemies game object, create another empty game object.
Let's call this zombies, create another one.
So right click, create a..
Let's call this.
But right click, create another empty.
And let's call this ghosts.
The reason why I do this is so that I'm sure it's going to be rendering the exact same objects in sequence.
All right.
So it's not going to have to switch shaders.
I've spoken about before.
I mean, the zombie character is using the same shader as the back, to be honest, this the mobile.
But I know the ghost is using a very different shader.
So that one's using the mobile particles additive.
So as long as they're in sequence, it just frees up performance for your and processor and your graphics
card.
So ghosts go onto ghosts.
But on Tebartz zombies.
Onto zombies.
There we go.
All right, that's a lot better.
So let's add some more zombie characters then controlling the.
Well, in a little bit further analysis, a little bit closer and control and another one.
This will maybe further back.
And you might want to check this out in the simulator as you doing this to see what this looks like
now, looks fine.
OK, and our ghosts from the.
This one here in front of the zombie.
And then another one, control and again, let's put on the back here.
OK, and then the bots control and de.
Put on over here.
Jolanda.
And maybe put on all the way over here like this.
OK, so now we've got four of each characters.
So what they want to do is in the script where I the if goes on screen less than two and no one to make
that less than four.
OK, same.
But on screen, less than four and zombies on screen less than four.
So when they scroll right up to the top and it says zombies on screen, you want to make up for to begin
with.
That's on screen for ghosts and screen for whatever numbers we've got.
And I think because I made those public, actually, I need to change those in the inspector as well.
You might change them in the script, but then when you check the inspector, it's still too.
All right, so that can catch a few people out.
There we go.
And yep, everything else is good.
OK, so now a lot more characters.
I might actually want my zombies just to move a little bit quicker.
So let's say almost on this.
And the speed zero point twenty five might make that about zero point five.
All right.
So twice as fast as they were previously.
And now in the mobile game resources, you've got some sound effects.
We've got a bat attack bite and Ghosttown.
OK, so those are going to be the attacks for each type of creature on the target.
Well, I want to do is other components of audio source.
I don't want it to play in the wake and I don't want it to loop.
Do you want it to be too DBI?
I actually don't want to drag any of these sounds into the audio clip.
We'll leave that as not.
And then inside of the script, we're actually going to add those dynamically.
OK.
Does this mean that we have to add a new script?
So right click create and you see script.
I'm going to call this one and damage.
Just open this one.
So inside of damage, we actually don't need an update or a start.
Get rid of those completely.
We do need access to that audio source.
So public offsite audio source.
I'm going to call it, uh, damage sound player.
Oh, actually, damage sound will be fine.
OK, then we need access to all three sound files.
So I'm going to say public audio clip.
And first one was, quote, backbite.
Public audio clip is this Ghosttown
public audio clip?
Let's call it zombie attack or maybe zombie bites, actually.
A file and save us.
On the target, I can now drag on the damaged script.
Here we go.
The audio source is going to be this one and sound files are going to be these.
OK, so bat attack is the backbite flesh bite.
This is a zombie bite and ghost.
How old is the ghost?
How?
So now that we've got access to them, we can dynamically just place those into the audio clip section
and get it to play this target as a box collider, which is a trigger.
Now we're going to do.
We're going to listen out for a zombie abat or ghost, and we're going to do that using the on trigger
enter.
So if I type void on trigger or enter, just press, enter or return to autocomplete and a lot of all
the other stuff.
So it's going to listen to the collider that was collided with it.
It's going to register it in this variable called although we need to say if all the dots compare tag
is let's say, but.
OK.
That is the case, and we're going to say damage sound dot klint.
Damage sound daft.
Audio clip.
Oh, there it is.
OK.
I thought it was Klip equals.
This is the bat, isn't it?
So it's the bat died and that will effectively just load that bite in the OK.
And then all we need to do is play.
So damage sound dot play.
That will play once and it will play that OK, and we need to do the same for the other characters control
and see drone control and be.
So now if we say it is ghost and it's going to load in the ghost howl.
And then if it is zombie, it's going to load in the zombie bite.
There we go.
All right, so that will then dynamically load those different sound files.
And now if we do get attacked by these creatures, we want some kind of a visual display on screen shows
that we've been attacked.
And that's where we of the art by candles, Halloween icons.
So if you go in textures and we take a look at the medium ones, we've got all these nice little textures.
So we've got a bat and a ghost.
And then obviously I've got a zombie scratch as well.
I'll show you in a second.
So on our canvas, want to do is right click UI new image drag in that set native cyes.
It's not a rakas tailgate because we don't need to click on it.
It's just a simple image.
And that will then get loaded.
So let's
pull up that image.
Switch it off and right click UI.
New image.
This one's going to be grave.
Set native sized, not a rakas target.
And let's call this ghost image.
Let's again switch that off, and the last one is in the mobile game resources.
It's this scratch canvas, right click UI image, Estragon, scratch set size.
There we go, another Rakas target.
And let's call this.
Zombie image
and switch it off to begin with.
All right, excellent.
So now in a script, Dummett script can actually and in fact, we don't need to do this actually in
in the in this script.
We can do that in may be easier.
What we do need to do is that if we get attacked by any other creature, as soon as he hits the box
in front of the player, the target is going to switch off the character.
OK, so we're going to say this, whatever.
Actually, no.
This to say, oh, the dart game object.
It's still active to false.
OK, so whatever hit, we're going to find the game object that's touched to I'm going to set that to
false, simply going to switch it off.
Let's just test this to begin with to make sure that the sounds play and the actual characters do switch
off.
So when you go to the game, you know, on mute audio, a simulator, let's just test this.
It might take a while for them to get here.
As we can see with the zombies, why didn't it work with the other creatures?
Ghost.
But.
Now I know why first is zombies and rigid body on them, OK, and without your body just won't register
that there's been a collision taking place.
So on all of our ghosts.
What are the components of Richard?
Well.
Make sure it's kinematics of don't fall instantly to the ground.
Same with our bats out of which body make those kinematic save and test again.
Whoo, whoo!
Whoo!
Excellent.
OK, so now it's working.
As you notice, they get switched off, but they don't get switched back on again.
We're going to deal with that shortly.
So I think in the next video, what we're going to do, we're going to move back over to the main script
and deal with it when the actual characters of attack you and then get them to respond in, get them
to actually damage the player.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.