Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:03,620 --> 00:00:09,260
In this video, we're going to have in a few more characters, and then we're going to have a damage
2
00:00:09,260 --> 00:00:10,400
system for our player.
3
00:00:10,790 --> 00:00:14,540
OK, so at the moment, we only have two of each character.
4
00:00:14,550 --> 00:00:18,740
So what they want is effectively a total of four of each characters.
5
00:00:18,740 --> 00:00:20,420
That gives us a total of 12.
6
00:00:20,870 --> 00:00:21,260
All right.
7
00:00:21,260 --> 00:00:28,160
So and the first thing I'm going to do is create a new empty game object, know, simply call this animes.
8
00:00:28,730 --> 00:00:30,590
That way we can keep them all together.
9
00:00:31,130 --> 00:00:34,760
OK, I'll just zero out the position.
10
00:00:35,210 --> 00:00:36,350
I always like to do that.
11
00:00:37,490 --> 00:00:43,320
And then we're going to take all of our enemies, put them in their.
12
00:00:48,050 --> 00:00:53,090
And then furthermore, inside of our enemies game object, create another empty game object.
13
00:00:53,570 --> 00:00:59,070
Let's call this zombies, create another one.
14
00:00:59,120 --> 00:01:01,220
So right click, create a..
15
00:01:02,000 --> 00:01:02,720
Let's call this.
16
00:01:03,120 --> 00:01:07,610
But right click, create another empty.
17
00:01:07,610 --> 00:01:09,080
And let's call this ghosts.
18
00:01:09,710 --> 00:01:17,390
The reason why I do this is so that I'm sure it's going to be rendering the exact same objects in sequence.
19
00:01:17,960 --> 00:01:18,320
All right.
20
00:01:18,330 --> 00:01:21,770
So it's not going to have to switch shaders.
21
00:01:22,130 --> 00:01:23,300
I've spoken about before.
22
00:01:25,160 --> 00:01:32,300
I mean, the zombie character is using the same shader as the back, to be honest, this the mobile.
23
00:01:32,990 --> 00:01:37,210
But I know the ghost is using a very different shader.
24
00:01:37,230 --> 00:01:39,890
So that one's using the mobile particles additive.
25
00:01:40,490 --> 00:01:47,810
So as long as they're in sequence, it just frees up performance for your and processor and your graphics
26
00:01:47,810 --> 00:01:48,140
card.
27
00:01:48,770 --> 00:01:51,350
So ghosts go onto ghosts.
28
00:01:51,600 --> 00:01:54,070
But on Tebartz zombies.
29
00:01:54,090 --> 00:01:55,010
Onto zombies.
30
00:01:59,360 --> 00:01:59,840
There we go.
31
00:01:59,960 --> 00:02:00,880
All right, that's a lot better.
32
00:02:01,850 --> 00:02:05,690
So let's add some more zombie characters then controlling the.
33
00:02:09,430 --> 00:02:16,180
Well, in a little bit further analysis, a little bit closer and control and another one.
34
00:02:20,670 --> 00:02:22,230
This will maybe further back.
35
00:02:23,130 --> 00:02:28,620
And you might want to check this out in the simulator as you doing this to see what this looks like
36
00:02:28,860 --> 00:02:29,700
now, looks fine.
37
00:02:30,430 --> 00:02:33,510
OK, and our ghosts from the.
38
00:02:40,770 --> 00:02:44,820
This one here in front of the zombie.
39
00:02:50,510 --> 00:02:57,520
And then another one, control and again, let's put on the back here.
40
00:02:59,410 --> 00:03:02,560
OK, and then the bots control and de.
41
00:03:05,680 --> 00:03:07,240
Put on over here.
42
00:03:09,960 --> 00:03:10,720
Jolanda.
43
00:03:12,030 --> 00:03:15,990
And maybe put on all the way over here like this.
44
00:03:16,290 --> 00:03:19,710
OK, so now we've got four of each characters.
45
00:03:22,530 --> 00:03:30,630
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
46
00:03:30,630 --> 00:03:31,620
that less than four.
47
00:03:32,250 --> 00:03:32,960
OK, same.
48
00:03:33,270 --> 00:03:37,980
But on screen, less than four and zombies on screen less than four.
49
00:03:38,880 --> 00:03:44,100
So when they scroll right up to the top and it says zombies on screen, you want to make up for to begin
50
00:03:44,100 --> 00:03:44,370
with.
51
00:03:44,550 --> 00:03:49,560
That's on screen for ghosts and screen for whatever numbers we've got.
52
00:03:51,200 --> 00:03:56,130
And I think because I made those public, actually, I need to change those in the inspector as well.
53
00:03:58,180 --> 00:04:03,100
You might change them in the script, but then when you check the inspector, it's still too.
54
00:04:03,550 --> 00:04:06,430
All right, so that can catch a few people out.
55
00:04:07,660 --> 00:04:08,200
There we go.
56
00:04:08,530 --> 00:04:11,110
And yep, everything else is good.
57
00:04:12,580 --> 00:04:15,910
OK, so now a lot more characters.
58
00:04:16,480 --> 00:04:19,450
I might actually want my zombies just to move a little bit quicker.
59
00:04:19,900 --> 00:04:21,380
So let's say almost on this.
60
00:04:21,910 --> 00:04:27,370
And the speed zero point twenty five might make that about zero point five.
61
00:04:27,790 --> 00:04:28,120
All right.
62
00:04:28,120 --> 00:04:31,630
So twice as fast as they were previously.
63
00:04:32,410 --> 00:04:37,180
And now in the mobile game resources, you've got some sound effects.
64
00:04:37,190 --> 00:04:40,210
We've got a bat attack bite and Ghosttown.
65
00:04:40,900 --> 00:04:46,930
OK, so those are going to be the attacks for each type of creature on the target.
66
00:04:47,420 --> 00:04:51,190
Well, I want to do is other components of audio source.
67
00:04:54,810 --> 00:04:56,940
I don't want it to play in the wake and I don't want it to loop.
68
00:04:57,090 --> 00:04:58,380
Do you want it to be too DBI?
69
00:04:58,380 --> 00:05:02,020
I actually don't want to drag any of these sounds into the audio clip.
70
00:05:02,040 --> 00:05:03,390
We'll leave that as not.
71
00:05:03,990 --> 00:05:08,730
And then inside of the script, we're actually going to add those dynamically.
72
00:05:09,360 --> 00:05:09,810
OK.
73
00:05:09,840 --> 00:05:13,410
Does this mean that we have to add a new script?
74
00:05:15,240 --> 00:05:20,220
So right click create and you see script.
75
00:05:20,610 --> 00:05:24,570
I'm going to call this one and damage.
76
00:05:29,410 --> 00:05:30,610
Just open this one.
77
00:05:33,070 --> 00:05:37,270
So inside of damage, we actually don't need an update or a start.
78
00:05:37,630 --> 00:05:38,980
Get rid of those completely.
79
00:05:39,670 --> 00:05:42,400
We do need access to that audio source.
80
00:05:42,640 --> 00:05:45,490
So public offsite audio source.
81
00:05:50,630 --> 00:05:56,730
I'm going to call it, uh, damage sound player.
82
00:05:58,920 --> 00:06:00,990
Oh, actually, damage sound will be fine.
83
00:06:01,530 --> 00:06:05,320
OK, then we need access to all three sound files.
84
00:06:05,340 --> 00:06:07,680
So I'm going to say public audio clip.
85
00:06:10,170 --> 00:06:13,050
And first one was, quote, backbite.
86
00:06:15,110 --> 00:06:21,110
Public audio clip is this Ghosttown
87
00:06:24,110 --> 00:06:26,150
public audio clip?
88
00:06:28,390 --> 00:06:35,180
Let's call it zombie attack or maybe zombie bites, actually.
89
00:06:38,690 --> 00:06:40,480
A file and save us.
90
00:06:47,330 --> 00:06:50,660
On the target, I can now drag on the damaged script.
91
00:06:51,230 --> 00:06:51,740
Here we go.
92
00:06:52,130 --> 00:06:59,280
The audio source is going to be this one and sound files are going to be these.
93
00:06:59,300 --> 00:07:02,420
OK, so bat attack is the backbite flesh bite.
94
00:07:02,450 --> 00:07:04,160
This is a zombie bite and ghost.
95
00:07:04,160 --> 00:07:05,300
How old is the ghost?
96
00:07:05,300 --> 00:07:05,630
How?
97
00:07:06,200 --> 00:07:12,290
So now that we've got access to them, we can dynamically just place those into the audio clip section
98
00:07:12,800 --> 00:07:18,050
and get it to play this target as a box collider, which is a trigger.
99
00:07:18,470 --> 00:07:19,130
Now we're going to do.
100
00:07:19,160 --> 00:07:25,820
We're going to listen out for a zombie abat or ghost, and we're going to do that using the on trigger
101
00:07:25,820 --> 00:07:26,240
enter.
102
00:07:27,410 --> 00:07:35,570
So if I type void on trigger or enter, just press, enter or return to autocomplete and a lot of all
103
00:07:35,570 --> 00:07:36,320
the other stuff.
104
00:07:36,950 --> 00:07:40,070
So it's going to listen to the collider that was collided with it.
105
00:07:40,070 --> 00:07:49,930
It's going to register it in this variable called although we need to say if all the dots compare tag
106
00:07:51,470 --> 00:07:54,290
is let's say, but.
107
00:07:56,380 --> 00:07:56,770
OK.
108
00:07:56,920 --> 00:08:03,580
That is the case, and we're going to say damage sound dot klint.
109
00:08:09,200 --> 00:08:10,910
Damage sound daft.
110
00:08:14,400 --> 00:08:15,300
Audio clip.
111
00:08:19,340 --> 00:08:20,000
Oh, there it is.
112
00:08:20,060 --> 00:08:20,470
OK.
113
00:08:21,090 --> 00:08:23,480
I thought it was Klip equals.
114
00:08:24,950 --> 00:08:26,450
This is the bat, isn't it?
115
00:08:26,450 --> 00:08:33,950
So it's the bat died and that will effectively just load that bite in the OK.
116
00:08:36,200 --> 00:08:37,670
And then all we need to do is play.
117
00:08:37,940 --> 00:08:41,720
So damage sound dot play.
118
00:08:44,250 --> 00:08:50,280
That will play once and it will play that OK, and we need to do the same for the other characters control
119
00:08:50,280 --> 00:08:52,880
and see drone control and be.
120
00:08:52,910 --> 00:09:00,180
So now if we say it is ghost and it's going to load in the ghost howl.
121
00:09:10,280 --> 00:09:16,430
And then if it is zombie, it's going to load in the zombie bite.
122
00:09:24,010 --> 00:09:24,520
There we go.
123
00:09:24,760 --> 00:09:28,810
All right, so that will then dynamically load those different sound files.
124
00:09:29,900 --> 00:09:37,900
And now if we do get attacked by these creatures, we want some kind of a visual display on screen shows
125
00:09:37,900 --> 00:09:38,920
that we've been attacked.
126
00:09:39,460 --> 00:09:45,490
And that's where we of the art by candles, Halloween icons.
127
00:09:46,300 --> 00:09:51,840
So if you go in textures and we take a look at the medium ones, we've got all these nice little textures.
128
00:09:51,850 --> 00:09:54,490
So we've got a bat and a ghost.
129
00:09:54,910 --> 00:09:58,000
And then obviously I've got a zombie scratch as well.
130
00:09:58,330 --> 00:09:59,500
I'll show you in a second.
131
00:09:59,980 --> 00:10:13,150
So on our canvas, want to do is right click UI new image drag in that set native cyes.
132
00:10:13,780 --> 00:10:16,210
It's not a rakas tailgate because we don't need to click on it.
133
00:10:16,270 --> 00:10:17,680
It's just a simple image.
134
00:10:18,700 --> 00:10:20,540
And that will then get loaded.
135
00:10:20,540 --> 00:10:21,370
So let's
136
00:10:24,250 --> 00:10:25,450
pull up that image.
137
00:10:26,650 --> 00:10:30,820
Switch it off and right click UI.
138
00:10:31,180 --> 00:10:32,200
New image.
139
00:10:33,250 --> 00:10:34,840
This one's going to be grave.
140
00:10:35,990 --> 00:10:38,440
Set native sized, not a rakas target.
141
00:10:38,770 --> 00:10:42,220
And let's call this ghost image.
142
00:10:47,260 --> 00:10:52,410
Let's again switch that off, and the last one is in the mobile game resources.
143
00:10:52,500 --> 00:11:04,330
It's this scratch canvas, right click UI image, Estragon, scratch set size.
144
00:11:04,420 --> 00:11:06,370
There we go, another Rakas target.
145
00:11:06,490 --> 00:11:07,780
And let's call this.
146
00:11:10,090 --> 00:11:11,320
Zombie image
147
00:11:14,140 --> 00:11:15,610
and switch it off to begin with.
148
00:11:15,880 --> 00:11:16,690
All right, excellent.
149
00:11:16,990 --> 00:11:27,340
So now in a script, Dummett script can actually and in fact, we don't need to do this actually in
150
00:11:27,420 --> 00:11:30,310
in the in this script.
151
00:11:30,310 --> 00:11:32,440
We can do that in may be easier.
152
00:11:33,160 --> 00:11:40,030
What we do need to do is that if we get attacked by any other creature, as soon as he hits the box
153
00:11:40,030 --> 00:11:43,900
in front of the player, the target is going to switch off the character.
154
00:11:44,320 --> 00:11:47,110
OK, so we're going to say this, whatever.
155
00:11:48,190 --> 00:11:48,760
Actually, no.
156
00:11:49,030 --> 00:11:52,870
This to say, oh, the dart game object.
157
00:11:53,710 --> 00:11:57,220
It's still active to false.
158
00:11:58,960 --> 00:12:05,290
OK, so whatever hit, we're going to find the game object that's touched to I'm going to set that to
159
00:12:05,290 --> 00:12:08,200
false, simply going to switch it off.
160
00:12:10,700 --> 00:12:15,650
Let's just test this to begin with to make sure that the sounds play and the actual characters do switch
161
00:12:15,650 --> 00:12:15,920
off.
162
00:12:16,580 --> 00:12:23,240
So when you go to the game, you know, on mute audio, a simulator, let's just test this.
163
00:12:29,780 --> 00:12:31,460
It might take a while for them to get here.
164
00:12:51,290 --> 00:12:56,630
As we can see with the zombies, why didn't it work with the other creatures?
165
00:12:57,970 --> 00:12:58,600
Ghost.
166
00:13:00,330 --> 00:13:00,890
But.
167
00:13:03,190 --> 00:13:14,530
Now I know why first is zombies and rigid body on them, OK, and without your body just won't register
168
00:13:14,530 --> 00:13:16,180
that there's been a collision taking place.
169
00:13:16,210 --> 00:13:17,830
So on all of our ghosts.
170
00:13:18,430 --> 00:13:21,520
What are the components of Richard?
171
00:13:21,640 --> 00:13:21,850
Well.
172
00:13:23,770 --> 00:13:27,190
Make sure it's kinematics of don't fall instantly to the ground.
173
00:13:27,880 --> 00:13:35,980
Same with our bats out of which body make those kinematic save and test again.
174
00:13:49,640 --> 00:13:51,430
Whoo, whoo!
175
00:13:53,470 --> 00:13:54,570
Whoo!
176
00:13:58,960 --> 00:13:59,530
Excellent.
177
00:13:59,830 --> 00:14:01,270
OK, so now it's working.
178
00:14:01,540 --> 00:14:05,140
As you notice, they get switched off, but they don't get switched back on again.
179
00:14:05,470 --> 00:14:07,360
We're going to deal with that shortly.
180
00:14:07,900 --> 00:14:11,500
So I think in the next video, what we're going to do, we're going to move back over to the main script
181
00:14:11,800 --> 00:14:20,890
and deal with it when the actual characters of attack you and then get them to respond in, get them
182
00:14:20,890 --> 00:14:22,600
to actually damage the player.
15421
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.