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
So in this video, we're now going to add a couple of extra animals and get those moving so in the assets
and then the level one monster park, we've got some really great creatures here.
So the first one that I want is basically a bat.
So I might choose this bat, read, write this into the scene and entirely show where it's put that
that's actually.
Oh, yeah, I do is put it there, but it's extremely small.
So I make it about 25 by 25 by 25.
Is that too big?
Uh, I think it might be.
Oh, actually, I looks about right.
And then just rotate that around.
It's looking at the play and then I'm just going to kind of move this up into the air.
Every young guy, a little character, all right, now, this part was made quite a long time ago.
And but it suits this perfectly.
All right.
It's really good Sundra Mesh.
It's already using mobile unlet as the texture type, which is perfect.
All we need to do basically is create an animated controller.
So I'll do that.
Right click create animated control for about uh, it's just like the animated controller into that.
And in the animator as long as clicking on.
But that's some reason.
Oh.
Is because it's locked.
Sorry about that.
Uh, let's make sure you lock that.
And we're looking for the animations.
So that's going to be on the models.
And but we should have a butterfly.
I think it's.
But move maybe.
Yeah, it looks pretty good.
All right, so we're just going to drag this one in here.
All right.
It's going to be default.
And then obviously when we kill it, it's going to be die.
All right, Celeste.
Disappear.
Right click.
Make a transition to die.
We don't need to transition back and we simply need the parameter trigger that is called die.
So on this, we simply call that trigger die.
No exit time.
And it's just simply going to go and it's going to go from bad move to die.
All right.
So in a scene, then let's attach that script that we created.
So in the mobile game, resources, my scripts and then we move onto.
But transform is the target.
Fadeless, maybe give this one slightly faster.
Speed one point five.
And now in the simulator.
You will see the bats start to fly toward the player.
All right, there we go.
It's coming toward the play pretty quick and then it kind of stops when he gets close enough.
All right.
And obviously it will attack the player.
Great.
So that's a nice little bat character.
And back into the level monsters.
Again, prefabs.
We also have ghost.
All right.
It looks pretty good for this.
One might choose like maybe a green ghost.
Might be pretty cool.
Something is going to track this.
And once again, let's just change the size.
For some reason, they could make really, really tiny, 25, 25 by 25.
Try this one up and rotate it around.
I think that's a little bit too small, actually.
Yeah, so this goes character, I'm going to make this one a lot bigger.
So let me try 45, 45 by 45.
That's much better.
All right.
So as you can see, it does look quite nice.
And it's just maybe move this one over this side.
Now, for this character, probably don't even need to either make this character really just simply
going to be moving toward toward the player.
So it can actually right click and even remove the animator of this.
Whenever you see this, where it says removed simply because this is prefund means that he's changed
from its original prefab.
Don't worry about that.
If you want not to disappear, you're right.
Click choose prefab and unpack completely and just get rid of that.
So on my mesh, I have my loved one.
This is using an omelette, transparent, cut out simply because this has some transparency at the bottom
there.
I would probably stick with that one.
That's a relatively fast shader.
Actually, let me try.
And mobile particles and something like Ilford blended.
It looks terrible.
And mobile particles additive.
Yeah.
Kind of like this actually looks a little bit more like a ghost because now you can kind of see behind
it.
It looks kind of fun.
All right.
And it's also a mobile do as well.
So I'll be super fast.
And so what?
I'm going to do that ghost green, too.
Let's call it and I'll direct this down into here in order to create a new prefab out of it.
Once again, we need the script.
So mobile game resources, my scripts and then move just on to go screen to the target speed may be
able to move pretty slowly, so about zero point seven.
So we've checked this now in the simulator.
You can see the ghosts coming towards us as well.
All right, so they're all kind of getting close.
Anything that's floating like the ghost of the script that we've got at the moment works fine, doesn't
work fine for the zombie at the moment.
And they're all kind of in the same position as they move around.
They sort of move to sort of stay in front of me, if you like.
Don't worry.
We're going to sort that out later so that when they get into position that's close to the character,
they're going to attack the characters and disappear.
All right.
But at the moment, that's that's working quite nice.
Now, at the moment, the script exists on three different characters, exists on Anime Zombie, but
in Ghost.
All right.
The same script and running three times.
And now, obviously, we're going to have more than three enemies in the game.
OK, so presumably in the end, we're going to have quite a lot of these scripts.
And now they are instances of the scripts, which basically means it only really has to access the same
script and change the elements.
But still having to go into the update each time and perform a calculation.
OK, a calculation is obviously going to put a bit of stress on the CPU if we can reduce the calculations
in New York date and just have simple move and coordinates.
That's going to be so much better.
So what we can do in order to optimize this is actually take this calculation out of the enemy, move
and put it directly into the main.
That means it only has to perform the calculation once and then transfer that to all the different enemies.
OK, so let's take a look at this.
So we need a public float of speed and we also need a step as well.
OK, so in our main, what we can do is I'm going to comment this so that I know exactly what it's doing.
This is going to be the enemy move speed.
I would definitely recommend commenting your scripts so that they make sense.
I'm going to comment this first part, which is joystick rotation.
OK, so we now need speed and the muchly going to make this private, because I'm actually planning
on using this as a game mechanic, whereby the characters kind of speed up every level.
OK, it makes it more interesting.
So I'm going to make that private.
You call it off type.
I will call speed
and I'll start that off all initializer.
Something like one.
Then we need this step.
OK, now, instead of actually calling this insider the update, whenever you call a function inside
an update.
It has to create a new new variable inside of this update.
And then as soon as it's finished, the update is to destroy it.
So you're constantly creating and destroying variables.
It's not a particularly great way to to use it on mobile.
You better establishing it at the top and it stays in memory pretty much throughout the entire game.
All right.
So is much more effective.
And so I need a step.
But they also need to be able to call that step from this anime movie script.
So what we need to do is basically create it as a public static variable, public static.
You're going to be available to all the scripts so that they can also access them as well.
And we call this step.
And I don't think we need to initialize that because it's being performed on a calculation.
All right.
So that's just simply going to hold that value.
So now in the update.
And once again, in the update, what I might do here is just comment.
All right.
Comments don't get added to the script purely for us.
The computer will not read any comments.
All right.
So this is a joystick rotation.
This is and you may move calculation.
So we're simply going to copy this.
All right, so in fact, let me just take all of this control and see control in the area.
Also, staight variable is going to be equal to speed multiplied by time Delta time.
All right.
We performed that calculation once every frame and only in one script.
So now in this script, instead of saying this step, we're going to say the name of the script, main
step.
It's going to access that variable instead of this one.
That means we can now delete this line.
We can even delete this variable.
And we've simplified this script to guest from multiple times because it's on loads and different animals.
So we've simplified it to optimize it.
Also, when we have a function as nothing in an empty function, it's not a good idea to leave that
function there.
All right.
Because even though it's empty, the computer still recognizes it's got a start function or an update
function, still going after open the script in order to read it.
It's going to find is nothing there.
So then it closes the script and goes on to the next one.
And if you take it out altogether, it's not going to recognize it.
All right.
So it doesn't need to open the script.
So what I'm going to do here is simply just comment it out by using the forward slash in it asterix,
followed by an asterix and a full backslash.
OK.
And that basically comments that element.
So now the computer basically will not see that start function in the save that.
So now it's all simplified just to make sure they still working.
I'm going to obviously go into the simulator and double check it.
OK, there we go.
They're all moving and obviously they're all moving at the same speed now.
Great.
All right, and obviously we've optimized the script.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.