Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:03,340 --> 00:00:09,760
So in this video, we're now going to add a couple of extra animals and get those moving so in the assets
2
00:00:09,760 --> 00:00:14,500
and then the level one monster park, we've got some really great creatures here.
3
00:00:14,950 --> 00:00:17,850
So the first one that I want is basically a bat.
4
00:00:17,890 --> 00:00:26,530
So I might choose this bat, read, write this into the scene and entirely show where it's put that
5
00:00:26,530 --> 00:00:27,340
that's actually.
6
00:00:30,790 --> 00:00:33,940
Oh, yeah, I do is put it there, but it's extremely small.
7
00:00:34,120 --> 00:00:39,910
So I make it about 25 by 25 by 25.
8
00:00:42,250 --> 00:00:43,000
Is that too big?
9
00:00:44,490 --> 00:00:47,470
Uh, I think it might be.
10
00:00:47,500 --> 00:00:48,910
Oh, actually, I looks about right.
11
00:00:49,480 --> 00:00:51,790
And then just rotate that around.
12
00:00:52,100 --> 00:00:57,580
It's looking at the play and then I'm just going to kind of move this up into the air.
13
00:00:59,580 --> 00:01:07,050
Every young guy, a little character, all right, now, this part was made quite a long time ago.
14
00:01:07,440 --> 00:01:11,010
And but it suits this perfectly.
15
00:01:11,190 --> 00:01:11,630
All right.
16
00:01:11,640 --> 00:01:14,070
It's really good Sundra Mesh.
17
00:01:14,160 --> 00:01:18,690
It's already using mobile unlet as the texture type, which is perfect.
18
00:01:19,260 --> 00:01:22,170
All we need to do basically is create an animated controller.
19
00:01:22,410 --> 00:01:23,670
So I'll do that.
20
00:01:24,300 --> 00:01:36,780
Right click create animated control for about uh, it's just like the animated controller into that.
21
00:01:37,440 --> 00:01:43,050
And in the animator as long as clicking on.
22
00:01:43,260 --> 00:01:46,620
But that's some reason.
23
00:01:46,620 --> 00:01:46,900
Oh.
24
00:01:46,980 --> 00:01:48,000
Is because it's locked.
25
00:01:48,030 --> 00:01:48,780
Sorry about that.
26
00:01:49,050 --> 00:01:50,670
Uh, let's make sure you lock that.
27
00:01:51,240 --> 00:01:55,470
And we're looking for the animations.
28
00:01:55,740 --> 00:01:57,570
So that's going to be on the models.
29
00:01:57,810 --> 00:02:01,710
And but we should have a butterfly.
30
00:02:01,980 --> 00:02:02,480
I think it's.
31
00:02:02,490 --> 00:02:03,660
But move maybe.
32
00:02:07,050 --> 00:02:08,460
Yeah, it looks pretty good.
33
00:02:08,820 --> 00:02:10,980
All right, so we're just going to drag this one in here.
34
00:02:11,370 --> 00:02:11,700
All right.
35
00:02:11,700 --> 00:02:12,840
It's going to be default.
36
00:02:13,260 --> 00:02:15,990
And then obviously when we kill it, it's going to be die.
37
00:02:16,560 --> 00:02:17,280
All right, Celeste.
38
00:02:17,480 --> 00:02:18,110
Disappear.
39
00:02:18,810 --> 00:02:19,530
Right click.
40
00:02:19,530 --> 00:02:21,210
Make a transition to die.
41
00:02:21,600 --> 00:02:29,530
We don't need to transition back and we simply need the parameter trigger that is called die.
42
00:02:31,110 --> 00:02:35,370
So on this, we simply call that trigger die.
43
00:02:35,550 --> 00:02:36,510
No exit time.
44
00:02:36,930 --> 00:02:45,300
And it's just simply going to go and it's going to go from bad move to die.
45
00:02:45,450 --> 00:02:45,870
All right.
46
00:02:48,570 --> 00:02:54,300
So in a scene, then let's attach that script that we created.
47
00:02:54,450 --> 00:02:58,860
So in the mobile game, resources, my scripts and then we move onto.
48
00:02:58,860 --> 00:03:02,970
But transform is the target.
49
00:03:03,420 --> 00:03:07,440
Fadeless, maybe give this one slightly faster.
50
00:03:07,440 --> 00:03:08,700
Speed one point five.
51
00:03:09,780 --> 00:03:11,280
And now in the simulator.
52
00:03:13,870 --> 00:03:16,540
You will see the bats start to fly toward the player.
53
00:03:16,840 --> 00:03:17,800
All right, there we go.
54
00:03:17,940 --> 00:03:22,750
It's coming toward the play pretty quick and then it kind of stops when he gets close enough.
55
00:03:23,250 --> 00:03:23,480
All right.
56
00:03:23,500 --> 00:03:25,210
And obviously it will attack the player.
57
00:03:26,560 --> 00:03:26,940
Great.
58
00:03:26,950 --> 00:03:29,410
So that's a nice little bat character.
59
00:03:30,140 --> 00:03:34,270
And back into the level monsters.
60
00:03:34,270 --> 00:03:35,410
Again, prefabs.
61
00:03:35,710 --> 00:03:37,330
We also have ghost.
62
00:03:37,660 --> 00:03:37,990
All right.
63
00:03:37,990 --> 00:03:39,520
It looks pretty good for this.
64
00:03:39,520 --> 00:03:41,740
One might choose like maybe a green ghost.
65
00:03:41,980 --> 00:03:42,880
Might be pretty cool.
66
00:03:43,330 --> 00:03:44,440
Something is going to track this.
67
00:03:44,450 --> 00:03:46,930
And once again, let's just change the size.
68
00:03:47,110 --> 00:03:54,070
For some reason, they could make really, really tiny, 25, 25 by 25.
69
00:03:57,100 --> 00:04:00,550
Try this one up and rotate it around.
70
00:04:04,220 --> 00:04:06,840
I think that's a little bit too small, actually.
71
00:04:07,730 --> 00:04:10,970
Yeah, so this goes character, I'm going to make this one a lot bigger.
72
00:04:11,060 --> 00:04:16,670
So let me try 45, 45 by 45.
73
00:04:18,710 --> 00:04:19,580
That's much better.
74
00:04:19,850 --> 00:04:20,290
All right.
75
00:04:20,300 --> 00:04:22,520
So as you can see, it does look quite nice.
76
00:04:23,420 --> 00:04:26,180
And it's just maybe move this one over this side.
77
00:04:30,720 --> 00:04:36,210
Now, for this character, probably don't even need to either make this character really just simply
78
00:04:36,210 --> 00:04:38,700
going to be moving toward toward the player.
79
00:04:39,030 --> 00:04:42,540
So it can actually right click and even remove the animator of this.
80
00:04:43,050 --> 00:04:48,720
Whenever you see this, where it says removed simply because this is prefund means that he's changed
81
00:04:48,720 --> 00:04:50,430
from its original prefab.
82
00:04:50,440 --> 00:04:51,270
Don't worry about that.
83
00:04:51,900 --> 00:04:53,490
If you want not to disappear, you're right.
84
00:04:53,490 --> 00:04:57,990
Click choose prefab and unpack completely and just get rid of that.
85
00:04:58,770 --> 00:05:01,590
So on my mesh, I have my loved one.
86
00:05:02,070 --> 00:05:11,310
This is using an omelette, transparent, cut out simply because this has some transparency at the bottom
87
00:05:11,310 --> 00:05:11,500
there.
88
00:05:12,360 --> 00:05:13,950
I would probably stick with that one.
89
00:05:14,310 --> 00:05:16,740
That's a relatively fast shader.
90
00:05:18,480 --> 00:05:20,250
Actually, let me try.
91
00:05:20,460 --> 00:05:26,340
And mobile particles and something like Ilford blended.
92
00:05:26,470 --> 00:05:28,080
It looks terrible.
93
00:05:31,370 --> 00:05:35,780
And mobile particles additive.
94
00:05:36,530 --> 00:05:37,020
Yeah.
95
00:05:37,160 --> 00:05:42,410
Kind of like this actually looks a little bit more like a ghost because now you can kind of see behind
96
00:05:42,410 --> 00:05:42,560
it.
97
00:05:44,510 --> 00:05:45,650
It looks kind of fun.
98
00:05:46,100 --> 00:05:46,640
All right.
99
00:05:46,970 --> 00:05:48,950
And it's also a mobile do as well.
100
00:05:49,760 --> 00:05:51,770
So I'll be super fast.
101
00:05:53,000 --> 00:05:54,170
And so what?
102
00:05:54,170 --> 00:05:58,340
I'm going to do that ghost green, too.
103
00:05:58,700 --> 00:06:04,010
Let's call it and I'll direct this down into here in order to create a new prefab out of it.
104
00:06:05,150 --> 00:06:06,920
Once again, we need the script.
105
00:06:07,250 --> 00:06:17,180
So mobile game resources, my scripts and then move just on to go screen to the target speed may be
106
00:06:17,180 --> 00:06:20,630
able to move pretty slowly, so about zero point seven.
107
00:06:22,170 --> 00:06:24,230
So we've checked this now in the simulator.
108
00:06:29,430 --> 00:06:31,500
You can see the ghosts coming towards us as well.
109
00:06:31,740 --> 00:06:34,500
All right, so they're all kind of getting close.
110
00:06:35,070 --> 00:06:39,900
Anything that's floating like the ghost of the script that we've got at the moment works fine, doesn't
111
00:06:39,900 --> 00:06:42,690
work fine for the zombie at the moment.
112
00:06:42,690 --> 00:06:46,530
And they're all kind of in the same position as they move around.
113
00:06:46,530 --> 00:06:51,240
They sort of move to sort of stay in front of me, if you like.
114
00:06:52,140 --> 00:06:52,650
Don't worry.
115
00:06:52,920 --> 00:06:56,700
We're going to sort that out later so that when they get into position that's close to the character,
116
00:06:56,700 --> 00:06:58,890
they're going to attack the characters and disappear.
117
00:07:00,210 --> 00:07:00,510
All right.
118
00:07:01,140 --> 00:07:03,270
But at the moment, that's that's working quite nice.
119
00:07:04,080 --> 00:07:13,320
Now, at the moment, the script exists on three different characters, exists on Anime Zombie, but
120
00:07:13,560 --> 00:07:14,160
in Ghost.
121
00:07:14,490 --> 00:07:14,910
All right.
122
00:07:15,300 --> 00:07:19,020
The same script and running three times.
123
00:07:20,070 --> 00:07:24,030
And now, obviously, we're going to have more than three enemies in the game.
124
00:07:24,150 --> 00:07:28,050
OK, so presumably in the end, we're going to have quite a lot of these scripts.
125
00:07:28,710 --> 00:07:34,950
And now they are instances of the scripts, which basically means it only really has to access the same
126
00:07:34,950 --> 00:07:36,960
script and change the elements.
127
00:07:37,060 --> 00:07:42,030
But still having to go into the update each time and perform a calculation.
128
00:07:42,960 --> 00:07:49,050
OK, a calculation is obviously going to put a bit of stress on the CPU if we can reduce the calculations
129
00:07:49,050 --> 00:07:53,190
in New York date and just have simple move and coordinates.
130
00:07:53,430 --> 00:07:54,690
That's going to be so much better.
131
00:07:55,230 --> 00:08:00,450
So what we can do in order to optimize this is actually take this calculation out of the enemy, move
132
00:08:00,750 --> 00:08:02,340
and put it directly into the main.
133
00:08:02,730 --> 00:08:08,220
That means it only has to perform the calculation once and then transfer that to all the different enemies.
134
00:08:08,940 --> 00:08:10,170
OK, so let's take a look at this.
135
00:08:10,500 --> 00:08:16,380
So we need a public float of speed and we also need a step as well.
136
00:08:16,710 --> 00:08:24,690
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.
137
00:08:25,380 --> 00:08:29,610
This is going to be the enemy move speed.
138
00:08:31,320 --> 00:08:35,160
I would definitely recommend commenting your scripts so that they make sense.
139
00:08:35,550 --> 00:08:41,520
I'm going to comment this first part, which is joystick rotation.
140
00:08:43,980 --> 00:08:54,030
OK, so we now need speed and the muchly going to make this private, because I'm actually planning
141
00:08:54,030 --> 00:08:58,560
on using this as a game mechanic, whereby the characters kind of speed up every level.
142
00:08:58,980 --> 00:09:00,570
OK, it makes it more interesting.
143
00:09:01,140 --> 00:09:02,790
So I'm going to make that private.
144
00:09:03,840 --> 00:09:05,970
You call it off type.
145
00:09:06,840 --> 00:09:08,340
I will call speed
146
00:09:10,950 --> 00:09:13,720
and I'll start that off all initializer.
147
00:09:13,740 --> 00:09:14,670
Something like one.
148
00:09:17,870 --> 00:09:20,000
Then we need this step.
149
00:09:20,480 --> 00:09:25,340
OK, now, instead of actually calling this insider the update, whenever you call a function inside
150
00:09:25,400 --> 00:09:25,910
an update.
151
00:09:26,270 --> 00:09:30,470
It has to create a new new variable inside of this update.
152
00:09:30,830 --> 00:09:33,470
And then as soon as it's finished, the update is to destroy it.
153
00:09:33,710 --> 00:09:36,590
So you're constantly creating and destroying variables.
154
00:09:36,950 --> 00:09:40,730
It's not a particularly great way to to use it on mobile.
155
00:09:40,970 --> 00:09:46,760
You better establishing it at the top and it stays in memory pretty much throughout the entire game.
156
00:09:47,300 --> 00:09:47,660
All right.
157
00:09:47,660 --> 00:09:49,070
So is much more effective.
158
00:09:49,730 --> 00:09:52,190
And so I need a step.
159
00:09:52,190 --> 00:09:56,120
But they also need to be able to call that step from this anime movie script.
160
00:09:56,660 --> 00:10:04,880
So what we need to do is basically create it as a public static variable, public static.
161
00:10:04,890 --> 00:10:09,170
You're going to be available to all the scripts so that they can also access them as well.
162
00:10:09,530 --> 00:10:10,580
And we call this step.
163
00:10:12,850 --> 00:10:17,990
And I don't think we need to initialize that because it's being performed on a calculation.
164
00:10:18,260 --> 00:10:18,620
All right.
165
00:10:19,070 --> 00:10:21,140
So that's just simply going to hold that value.
166
00:10:21,680 --> 00:10:23,510
So now in the update.
167
00:10:25,550 --> 00:10:30,650
And once again, in the update, what I might do here is just comment.
168
00:10:30,950 --> 00:10:31,310
All right.
169
00:10:31,520 --> 00:10:34,640
Comments don't get added to the script purely for us.
170
00:10:34,850 --> 00:10:36,980
The computer will not read any comments.
171
00:10:37,010 --> 00:10:37,370
All right.
172
00:10:38,210 --> 00:10:41,210
So this is a joystick rotation.
173
00:10:45,250 --> 00:10:50,200
This is and you may move calculation.
174
00:10:53,620 --> 00:10:56,200
So we're simply going to copy this.
175
00:10:56,230 --> 00:11:02,650
All right, so in fact, let me just take all of this control and see control in the area.
176
00:11:02,650 --> 00:11:08,140
Also, staight variable is going to be equal to speed multiplied by time Delta time.
177
00:11:08,920 --> 00:11:09,220
All right.
178
00:11:09,230 --> 00:11:14,020
We performed that calculation once every frame and only in one script.
179
00:11:14,270 --> 00:11:20,590
So now in this script, instead of saying this step, we're going to say the name of the script, main
180
00:11:20,950 --> 00:11:21,430
step.
181
00:11:22,140 --> 00:11:24,550
It's going to access that variable instead of this one.
182
00:11:25,000 --> 00:11:26,740
That means we can now delete this line.
183
00:11:28,020 --> 00:11:30,010
We can even delete this variable.
184
00:11:31,330 --> 00:11:36,640
And we've simplified this script to guest from multiple times because it's on loads and different animals.
185
00:11:36,940 --> 00:11:38,950
So we've simplified it to optimize it.
186
00:11:39,730 --> 00:11:46,630
Also, when we have a function as nothing in an empty function, it's not a good idea to leave that
187
00:11:46,630 --> 00:11:47,410
function there.
188
00:11:47,710 --> 00:11:48,070
All right.
189
00:11:48,070 --> 00:11:54,370
Because even though it's empty, the computer still recognizes it's got a start function or an update
190
00:11:54,370 --> 00:11:57,850
function, still going after open the script in order to read it.
191
00:11:58,480 --> 00:11:59,870
It's going to find is nothing there.
192
00:11:59,890 --> 00:12:02,410
So then it closes the script and goes on to the next one.
193
00:12:03,100 --> 00:12:06,850
And if you take it out altogether, it's not going to recognize it.
194
00:12:06,880 --> 00:12:07,210
All right.
195
00:12:07,210 --> 00:12:08,830
So it doesn't need to open the script.
196
00:12:09,370 --> 00:12:14,170
So what I'm going to do here is simply just comment it out by using the forward slash in it asterix,
197
00:12:14,470 --> 00:12:17,350
followed by an asterix and a full backslash.
198
00:12:17,680 --> 00:12:18,040
OK.
199
00:12:19,750 --> 00:12:21,670
And that basically comments that element.
200
00:12:21,880 --> 00:12:27,550
So now the computer basically will not see that start function in the save that.
201
00:12:28,200 --> 00:12:31,660
So now it's all simplified just to make sure they still working.
202
00:12:32,300 --> 00:12:34,690
I'm going to obviously go into the simulator and double check it.
203
00:12:42,270 --> 00:12:42,970
OK, there we go.
204
00:12:43,020 --> 00:12:45,770
They're all moving and obviously they're all moving at the same speed now.
205
00:12:49,280 --> 00:12:49,640
Great.
206
00:12:49,880 --> 00:12:53,360
All right, and obviously we've optimized the script.
17617
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.