1
00:00:00,000 --> 00:00:03,170
Welcome back, my fellow game developers.

2
00:00:03,165 --> 00:00:05,495
In this video, as promised,

3
00:00:05,490 --> 00:00:08,990
we've added a bit of brutality to the way our enemy dies.

4
00:00:08,985 --> 00:00:13,045
So now when I shoot him with DO bullets, look what happens.

5
00:00:13,049 --> 00:00:17,129
1, 2, and you can see the blood splashing from him.

6
00:00:17,130 --> 00:00:18,860
Now even though he's a skeleton,

7
00:00:18,855 --> 00:00:21,065
technically he doesn't have blood.

8
00:00:21,060 --> 00:00:25,350
But let's use our imagination and figure something out.

9
00:00:25,350 --> 00:00:28,190
Anyways, let's not waste any more time.

10
00:00:28,185 --> 00:00:31,695
The challenge in this video will be a like,

11
00:00:31,695 --> 00:00:35,145
let's say me versus you who can do the challenge faster.

12
00:00:35,145 --> 00:00:39,105
So I need your full attention and concentration.

13
00:00:39,105 --> 00:00:41,095
Let's not waste anymore time.

14
00:00:41,095 --> 00:00:43,625
Let's get started.

15
00:01:43,900 --> 00:01:47,000
Which is a new kind of challenge.

16
00:01:47,000 --> 00:01:49,070
And who can do with faster?

17
00:01:49,070 --> 00:01:49,460
Why?

18
00:01:49,460 --> 00:01:52,360
Because you have all the tools necessary.

19
00:01:52,355 --> 00:01:55,375
We're doing something that we've done a lot of times before.

20
00:01:55,370 --> 00:01:58,550
So my goal right now is to see who can do it faster.

21
00:01:58,550 --> 00:02:00,130
Can you do it faster than me?

22
00:02:00,125 --> 00:02:02,995
And we're going to have a small cup petition before we start

23
00:02:02,990 --> 00:02:06,020
to create a splatter sprites.

24
00:02:06,019 --> 00:02:12,339
So the Animation create a serialized field of the death splatter, where should it be?

25
00:02:12,335 --> 00:02:14,665
And finally, before we destroy the enemy,

26
00:02:14,660 --> 00:02:18,770
we are going to instantiate this death splatter.

27
00:02:18,770 --> 00:02:20,980
So I hope you're up to the challenge.

28
00:02:20,975 --> 00:02:25,705
Let's not waste any more time and let's get started. Don't pause the video.

29
00:02:25,700 --> 00:02:28,270
Let's go. Let's go. Okay, so first thing,

30
00:02:28,265 --> 00:02:30,815
no pressure, no pressure.

31
00:02:30,815 --> 00:02:34,085
It's not like you're going against the instructor.

32
00:02:34,085 --> 00:02:39,905
Anyways, blood splatter, we are inside of this Brights.

33
00:02:39,905 --> 00:02:46,075
I'm going to go here and we have already everything sliced up.

34
00:02:46,070 --> 00:02:49,700
I'm going to add this file open up. There we go.

35
00:02:49,700 --> 00:02:51,110
You can see it right here.

36
00:02:51,110 --> 00:02:54,190
Let's go ahead and right-click create an empty game object.

37
00:02:54,185 --> 00:02:56,635
I'm going to reset its position right here.

38
00:02:56,630 --> 00:03:01,330
I'm going to go ahead into the animations, great animation.

39
00:03:01,325 --> 00:03:04,395
This will be in the assets and animations.

40
00:03:04,399 --> 00:03:05,939
Right-click.

41
00:03:08,800 --> 00:03:12,080
There you go. Side of V, right-click.

42
00:03:12,080 --> 00:03:18,240
Oh, no, So lot splashing.

43
00:03:18,510 --> 00:03:21,210
After.

44
00:03:21,205 --> 00:03:23,455
Enemy.

45
00:03:23,490 --> 00:03:26,670
A very long name for an animation.

46
00:03:26,665 --> 00:03:29,865
Now I'm going to choose all of the sprites,

47
00:03:29,860 --> 00:03:31,600
go ahead and add them in here.

48
00:03:31,600 --> 00:03:33,700
Let's run this and see how that looks.

49
00:03:33,700 --> 00:03:35,550
Okay, That's a lot of lot.

50
00:03:35,545 --> 00:03:40,065
So I'm going to choose all of that and maybe make the pixels per unit a bit more,

51
00:03:40,060 --> 00:03:43,920
maybe 120 or 150.

52
00:03:43,915 --> 00:03:45,385
Apply that.

53
00:03:45,385 --> 00:03:47,595
Let's try this animation again.

54
00:03:47,590 --> 00:03:49,080
Book. Oh, okay.

55
00:03:49,075 --> 00:03:50,535
It is a bit smaller.

56
00:03:50,530 --> 00:03:52,710
Let's make it ten seconds.

57
00:03:52,705 --> 00:03:54,195
Okay.

58
00:03:54,190 --> 00:03:57,250
Maybe I'll even keep it for 20.

59
00:03:57,250 --> 00:04:01,370
Let's see. Okay, so I think 20 is good enough.

60
00:04:01,365 --> 00:04:02,605
Let's go, let's go, let's go.

61
00:04:02,600 --> 00:04:06,740
Next thing we're going to do is we're going into the NMI controller in here.

62
00:04:06,740 --> 00:04:09,020
We'll get a reference to the blood splatter.

63
00:04:09,020 --> 00:04:12,730
I'm going to go ahead and after the damage.

64
00:04:12,725 --> 00:04:17,095
So serialized field, which is going to be the mature,

65
00:04:17,090 --> 00:04:22,160
call it a game object as the death splatter.

66
00:04:22,160 --> 00:04:23,300
Why does butter?

67
00:04:23,300 --> 00:04:24,440
I'm not even sure.

68
00:04:24,440 --> 00:04:27,250
I'll just keep it at the end because all the effects,

69
00:04:27,245 --> 00:04:30,445
it's always better to add the effects at the end.

70
00:04:30,440 --> 00:04:31,420
Save that.

71
00:04:31,415 --> 00:04:35,555
What else should we do when we get destroyed right here?

72
00:04:35,554 --> 00:04:38,584
Or, oh, I, well,

73
00:04:38,585 --> 00:04:40,105
a huge mistake by me,

74
00:04:40,100 --> 00:04:44,720
not in the player controller right here and the enemy, save that.

75
00:04:44,720 --> 00:04:51,500
Oh, okay, so you now have a head-start over me because of my stupid mistakes.

76
00:04:51,500 --> 00:04:54,080
No worries, we save that scroll down to the enemy.

77
00:04:54,080 --> 00:04:56,270
Where does he died before he gets destroyed,

78
00:04:56,270 --> 00:05:05,060
I'm going to instantiate the deaf splatter at the transform dot position.

79
00:05:05,060 --> 00:05:08,950
So I hope you are well on your road because I'm

80
00:05:08,945 --> 00:05:14,005
almost finished transform dot rotation and maybe you're just waiting for me and laughing.

81
00:05:14,000 --> 00:05:16,330
So save that everything is good.

82
00:05:16,325 --> 00:05:18,655
Go back in here, the game object,

83
00:05:18,650 --> 00:05:22,940
this is the load splatters.

84
00:05:22,940 --> 00:05:24,080
Save that.

85
00:05:24,080 --> 00:05:26,080
And the enemy also,

86
00:05:26,075 --> 00:05:27,355
we are going to prefer this,

87
00:05:27,350 --> 00:05:32,290
so we'll go into the refunds. There we go.

88
00:05:32,285 --> 00:05:35,875
Blood splattered, added and here go to the enemy.

89
00:05:35,870 --> 00:05:40,210
He gets the death splatter removed from the hierarchy,

90
00:05:40,205 --> 00:05:42,325
save that, run the game.

91
00:05:42,320 --> 00:05:45,340
Should the enemy twice? He does.

92
00:05:45,335 --> 00:05:50,425
And I can see the blood splatter, but oh,

93
00:05:50,420 --> 00:05:58,210
I think we forgot to make sure that the sprite renderer is on the where should I add it?

94
00:05:58,205 --> 00:06:01,385
Which, or I can add a sorting layer.

95
00:06:01,385 --> 00:06:05,845
Let's see, let's think about this for a second.

96
00:06:05,840 --> 00:06:08,990
I can add 0, so the enemies, Okay, great.

97
00:06:08,990 --> 00:06:11,450
So for the enemy, save that.

98
00:06:11,450 --> 00:06:15,280
And now when we shoot the enemy twice,

99
00:06:15,275 --> 00:06:16,955
we should see the blood.

100
00:06:16,954 --> 00:06:19,204
Okay, great. So, but as you can see,

101
00:06:19,205 --> 00:06:20,665
we have it on loop.

102
00:06:20,660 --> 00:06:24,940
So I'm going to go into the animations,

103
00:06:24,935 --> 00:06:28,075
blood and remove the loop time,

104
00:06:28,070 --> 00:06:30,640
save that, run the game again.

105
00:06:30,635 --> 00:06:33,635
And we should have a very nice,

106
00:06:33,635 --> 00:06:36,805
very nice splash of blood.

107
00:06:36,800 --> 00:06:38,710
And there you go, disappears.

108
00:06:38,705 --> 00:06:42,565
We need to make sure that there are a couple of inconveniences.

109
00:06:42,560 --> 00:06:46,300
So at the end, we might want to go ahead and destroy this.

110
00:06:46,295 --> 00:06:47,615
So to do that,

111
00:06:47,615 --> 00:06:50,525
let us go into our scripts in here.

112
00:06:50,525 --> 00:06:57,505
And we've already created some kind of script which was the impact effect destroyer.

113
00:06:57,500 --> 00:07:02,180
We can, by the way, let's go ahead and go into the Prefabs,

114
00:07:02,180 --> 00:07:03,500
choose the blood splatter.

115
00:07:03,500 --> 00:07:05,330
We have this little lock in here,

116
00:07:05,330 --> 00:07:07,300
so this is no longer part of the challenge.

117
00:07:07,295 --> 00:07:09,875
This is something extra that will add.

118
00:07:09,875 --> 00:07:13,105
I even forgot about the destruction of this.

119
00:07:13,100 --> 00:07:21,220
And we can go ahead and add the impact effect, destroyer, destroyer.

120
00:07:21,215 --> 00:07:27,625
So now I can access this right here and I can tell it that when we get to

121
00:07:27,620 --> 00:07:31,370
the last frame and maybe we can even keep it

122
00:07:31,370 --> 00:07:35,510
for maybe a couple of milliseconds right here,

123
00:07:35,510 --> 00:07:36,890
so the blood is on the ground.

124
00:07:36,890 --> 00:07:40,630
After we finish, we add this little fact,

125
00:07:40,625 --> 00:07:44,105
remove the lock and the animation event.

126
00:07:44,105 --> 00:07:47,095
What seems to be the problem here?

127
00:07:47,090 --> 00:07:49,330
Some kind of key, it's opened up.

128
00:07:49,325 --> 00:07:51,655
Okay, So we have the destroyed,

129
00:07:51,650 --> 00:07:58,280
but for some reason the blood splashing after the enemy.

130
00:07:58,280 --> 00:07:59,750
Hey, welcome back.

131
00:07:59,750 --> 00:08:03,230
So there was a tiny problem when I added the event,

132
00:08:03,230 --> 00:08:04,810
I had something different.

133
00:08:04,805 --> 00:08:08,695
The problem was that if you don't have the blood splatter,

134
00:08:08,690 --> 00:08:10,330
for example, in the hierarchy,

135
00:08:10,325 --> 00:08:11,425
when you add an event,

136
00:08:11,420 --> 00:08:12,500
it looks a bit weird.

137
00:08:12,500 --> 00:08:13,520
Let me show you again.

138
00:08:13,520 --> 00:08:17,660
So I chose the blood splatter and the animation choose the blood spatter.

139
00:08:17,660 --> 00:08:19,510
So you can see there is no animation.

140
00:08:19,505 --> 00:08:23,015
We first need to add it in here in the hierarchy and our scene.

141
00:08:23,015 --> 00:08:24,835
Then we can go ahead and add

142
00:08:24,830 --> 00:08:29,000
the little event that me just do this one more time. So there you go.

143
00:08:29,000 --> 00:08:32,770
And about 50, I'm going to add this function right here.

144
00:08:32,765 --> 00:08:34,945
I'm going to access the destroy,

145
00:08:34,940 --> 00:08:37,360
save that, run the game.

146
00:08:37,355 --> 00:08:41,275
Now, I kill the enemy with a couple of bullets.

147
00:08:41,270 --> 00:08:44,060
The splatter happens book,

148
00:08:44,060 --> 00:08:47,120
and then it gets removed by itself.

149
00:08:47,120 --> 00:08:48,860
We no longer have it in our hierarchy.

150
00:08:48,860 --> 00:08:50,000
So I hope you enjoy it.

151
00:08:50,000 --> 00:08:51,380
I hope you did the challenge.

152
00:08:51,380 --> 00:08:53,690
Maybe you didn't do it as fast as me.

153
00:08:53,690 --> 00:08:54,740
You pause the video,

154
00:08:54,740 --> 00:08:57,240
you tried a couple of things yourself.

155
00:08:57,244 --> 00:08:58,474
It's a bit advanced.

156
00:08:58,475 --> 00:08:59,785
Everything that we used,

157
00:08:59,780 --> 00:09:02,020
we already know the instantiation.

158
00:09:02,015 --> 00:09:06,025
The what is the effect that we created,

159
00:09:06,020 --> 00:09:08,150
the animation, the transformed position,

160
00:09:08,150 --> 00:09:09,380
all of that we've done,

161
00:09:09,380 --> 00:09:11,470
maybe the only bit of challenge,

162
00:09:11,465 --> 00:09:14,255
maybe you didn't know where you should have added this.

163
00:09:14,255 --> 00:09:16,385
Maybe you added after the destroy.

164
00:09:16,385 --> 00:09:20,615
I don't think that works if you've added it after you destroy so well done,

165
00:09:20,615 --> 00:09:24,205
make sure to commit your changes, I hope you enjoyed.

166
00:09:24,200 --> 00:09:30,320
And in the next video we are going to add some brutality to the way we hurt our enemy.

167
00:09:30,320 --> 00:09:31,610
So currently when we shoot him,

168
00:09:31,610 --> 00:09:32,980
he doesn't feel anything,

169
00:09:32,975 --> 00:09:36,055
but we will make sure that he does.

170
00:09:36,050 --> 00:09:37,880
And by the way, also,

171
00:09:37,880 --> 00:09:40,580
we have the death animation that you can create for

172
00:09:40,580 --> 00:09:43,340
the enemy and added to him when he dies,

173
00:09:43,340 --> 00:09:44,450
some kind of trigger.

174
00:09:44,450 --> 00:09:45,850
Maybe we'll do it later on.

175
00:09:45,845 --> 00:09:49,735
If you don't want too late for my lazy behind,

176
00:09:49,730 --> 00:09:52,870
you can go ahead and do it right now in between videos.

177
00:09:52,865 --> 00:09:56,075
So I'll see you in the next one.

