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
How did you get on with that task?
Hopefully now you can actually destroy the bat and the ghost.
So let's take a look at what we've done.
So on the bat, simply create a new tag called but the new town called Ghost, given the bat, the tiger
bat and the box collider on there.
Now the box Gladesville come in.
Absolutely huge to begin with.
So I'm using the value size of zero point zero three zero point zero five zero point to three.
OK.
And then the same for the ghost.
The ghost, just the ghost.
And the size of the box collider is zero point zero three.
OK.
And then in script.
We simply have pretty much a duplicate of this, actually, so it transformed the competition, but
it runs the dye trigger on the animation and then we start Coroutine called, but that's ghost.
There's no animation, so we just simply start coroutine called ghost deaths.
OK, be careful not to run your physics recast too many times.
You only really need to call it once and then all of your checks to see what they hit can take place
inside of there.
OK, and then down here, we've got a enumerator death yield return and I've created a new wait for
second called death time hit transform game object so that it falls.
Same with the ghost.
And I'm using that same death time.
But so what I've done.
Wait four seconds.
But death time, do you wait for seconds?
All right.
Because they can be destroyed a lot quicker than the zombies.
The zombie has a longer death on the machine.
All right.
That's so easy to others.
And I will be nice when we actually kill one of these animals that we get some kind of particle effects
to appear.
And that's what we've got.
This pack jamo assets, cartoon effects for the one that I want to use, first of all, is CFX three
and Misk is CFX three skull explosion.
Now, feel free to check them all out.
See what they are.
And choose your own if you want.
But as I do, put this into the game world.
You'll see what that looks like.
All right.
Quite nice.
Now we can see it's actually made up of multiple elements.
Each one of these elements is going to have its own shader.
All right.
Now the cartoon effects, particle additives.
But it is going to add to your draw calls volitionally.
But not not too bad.
I mean, like say as long as we can stay below a thousand draw calls, we should be perfectly fine and.
Now, on your particle effects, obviously it's got a lot of parameters, one of which is a script that
says auto destruct that will basically destroy after a certain amount of time.
What we want to do is only deactivate basically just switches it off until it's called again.
And this is for optimization purposes and it's brilliant for mobile devices means that we don't have
to keep Spolin in new particle effects, which we use the same one over and over again and show this
as play in the wake checked, which we should do.
And we're just going to switch this off to begin with.
We simply just going to switch it on and off as when needed, getting us to game object, create empty
all this particle X so we can keep all of these in place and then drag this one onto that object.
And yeah.
All right, that's perfectly fine.
And think of this almost like folder.
I can just close.
Also, if we can keep all of these items together, basically means that they're going to render in
sequence.
So was going to speed up the process as they are very similar types.
Each time that it goes through, I mean, it has to go through the hierarchy and order anyway.
Well, let's say that we have the possible effects and then we have the ghost and then we have particle
effects and then we have the bat.
Well, these particle effects of a shader of cartoon effects, and these ones have a different shader.
OK, if I can find it, this one, those mobile particles additive.
Well, each time it goes through here, it's basically switching these shaders over.
So if you can keep objects together, share the same shaders, means it doesn't have to keep switching
negotiators around.
So it's going to make it much faster to render.
All right.
It's going to take a lot of stress off of the processor and the graphics card.
Now, all we need to do is basically move these particle effects to wherever I hit, took place, whichever
object we hit.
OK, so in our script I'm going to do beneath a shooting is we're going to say particles.
So we need a public game object.
Simply call zombie particles.
And in our shoot, what we're going to do if we've hit the zombie just before we start a routine, we're
actually going to switch on the zombie particles.
So zombie particles dot.
Well, actually, let's move them first transform got position equals the hit that transformed opposition,
move them into place and then we can switch them on.
So some zombie particle's.
So seductive.
True.
OK.
And now you might be wondering, for example, on this one, our viewers hit or transformed up game
objects.
I like to focus in on this one.
I've just use zombie particles.
So, Dr. Drew, why have I use two different systems?
OK, well, on this one, the hit is actually the collider.
So if I just simply do hits seductive?
True or false?
Or it's going to do is switch off a collider.
So in this one, they have to access its transform and then its parent game object and set that to false.
Whereas on this to some B particles have been brought in as a game object.
So by doing so active on that, I know I'm switching off the entire game object.
OK.
However, I don't want those particles to remain on forever.
So as part of my zombie death.
OK, and I'm going to simply switch those off after.
Oh, actually, no, wait a second.
Wait a second.
The script should do that for me.
That's what this does.
Auto destruct only deactivate.
So after the animation is played, that will automatically switch the particles off.
All right.
So that's good.
Let's try this.
Just for the zombie.
Oh, I know why I love Red ever.
Oh, no, actually, I haven't.
OK, that's interesting.
I forgot to include the particles.
All right.
I'm going to have.
Well, perhaps I forgot to save.
OK, just make sure that you do safe, this one that has got Asterix shows with all that work that just
hasn't been assigned.
So fail safe, OK?
Now, as it compiles, I should have an empty game slot on my main.
We go right to the bottom zombie particles.
So now I can drag this skull explosion into that.
All right.
Now let's see what happens.
OK, and we can see those nice particle effects.
Excellent.
OK.
And so now it's just a case of setting up all of the other particle effects.
And so the ones that I quite like, as I say, choose your own for the bats.
I quite like the anime deaths.
So this one as if I drag this one into the game world.
You can see this.
All right.
I think that's quite nice.
Oh, this one has a light.
OK, I definitely don't recommend the light.
So let's get rid of that in order to get rid of it.
We need to first break the pref up.
So right click prefab.
Unpack completely.
Then we can get rid of this light.
Let's get rid of that inner glow and scroll and smoke circles.
Any one of these you can get rid of if you want it.
All right.
Let's just see what we've got now.
Yeah, quite like that.
And only one to deactivate this.
And it is play on the week.
All right.
So I'm just going to switch this one off and drag that onto the particle effects.
So now I just need to add this to my script.
So this is going to be a probably game object
called bat particles.
And then I simply I'm just going to copy these two lines, control and see do the same on the back to
control and be this time instead of zombie particles, I simply do, but particles.
Here we go.
All right.
And then for the ghost, let me just make sure I save that.
For the ghost, I'm choosing some sparks.
OK, so this is CFX four and sparks explosions.
You see what this looks like.
All right.
Nice and easy.
And this one just does one element in.
All right, which is fantastic.
Only the activate and does play in the weeks on.
Just simply going to switch this one off to begin with.
Track this onto the particle effects.
Let's now at this.
Public game objects.
And we have, uh, ghost particles.
So once again, I can just copy these two elements, control and see before I run the curtain.
Simply change this to ghost particles.
Excellent.
All right, so now I can save this.
And just out these particles to the script.
So on the ground, we now have two empty game slots.
One of them is the enemy death skull and the other one is the Sparks explosion.
All right, time to check this out now.
So maybe killed about that.
Here we go.
Kill the ghost.
He disappears and obviously the zombie.
All right, excellent.
Yep, so we've got all sorts of interesting political effects going on as well now as a little bit of
tusk.
I would recommend going back into your profiler and taking a look at the changes that have happened
as a result of adding all these extra elements.
Just take a look at the performance overall and how it's affected your frames per second.
Hopefully there's been almost no change whatsoever.
Hopefully it's very, very mind you, and your frames per second should still be extremely high on the
computer.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.