WEBVTT

00:00.170 --> 00:06.380
Now let's go into the game and set up sound for a couple of things here, and I'm going to show you

00:06.380 --> 00:10.700
a trick on how you can make sound effects sound a little bit better.

00:10.700 --> 00:14.360
It's going to make them sound different every time.

00:14.360 --> 00:15.530
Like a little bit different.

00:15.560 --> 00:16.190
Not that much.

00:16.190 --> 00:20.030
It will just give it a minor difference that makes it better.

00:20.030 --> 00:22.130
Let's go to level one.

00:22.130 --> 00:23.750
I'm going to save everything.

00:25.950 --> 00:28.530
And over here we don't have audio manager.

00:29.070 --> 00:33.030
We're going to transfer it from the main menu later on, but as of now we need it.

00:33.030 --> 00:34.500
So I'm going to do audio.

00:34.500 --> 00:38.010
Oh wait I don't want to put sounds again okay let's delete it.

00:38.010 --> 00:42.750
Let's go to scene main menu save asset Prefab.

00:42.900 --> 00:45.360
And I'm going to drag Audio Manager here.

00:45.360 --> 00:48.630
Then I'm going to go to Asset Scene level one.

00:50.080 --> 00:54.760
Save asset prefab audio manager.

00:55.710 --> 00:57.120
Oh yeah.

00:57.120 --> 01:04.140
So as I said before, later on Audio Manager are going to be transferred from the main menu to the game

01:04.470 --> 01:05.460
like scene.

01:05.460 --> 01:08.160
So we don't need to have it here, but now we need to test it.

01:08.160 --> 01:09.600
That's why I'm putting it here.

01:09.600 --> 01:12.300
And let me take the apple.

01:12.300 --> 01:18.900
Maybe I'm going to place it here and I'm going to make duplication of the apples.

01:20.220 --> 01:21.450
Uh, like that.

01:21.480 --> 01:27.060
Also, I want to adjust the level for this testing, so I'm going to do something like that okay.

01:27.360 --> 01:28.650
So now I have.

01:33.260 --> 01:36.140
Bunch of apples that I can pick up.

01:36.260 --> 01:37.910
Let's go to the fruit.

01:39.740 --> 01:43.040
And every time we pick up the fruit, we can play the sound.

01:43.670 --> 01:50.090
Uh, maybe here we can do audio manager, dot instance play suffix, and we need to check the number.

01:50.840 --> 01:55.040
So on the audio manager there is a pick up one and pick up two.

01:55.070 --> 01:56.210
You can check them both.

01:56.210 --> 01:58.700
I'm just going to use the number seven.

01:59.090 --> 02:01.040
So we pass number seven over here.

02:03.030 --> 02:05.370
And let's go and hear the sound.

02:05.370 --> 02:06.930
How does it play right now?

02:13.550 --> 02:16.460
Okay, first of all, it's kind of loud, right?

02:16.460 --> 02:20.510
And also it sounds good, but it sounds very similar.

02:21.020 --> 02:22.730
Also, let me try number eight.

02:28.460 --> 02:30.080
I'm going to go to audio manager.

02:30.080 --> 02:33.200
Find these two sounds pick up.

02:33.200 --> 02:35.330
I'm going to make them lower in volume.

02:35.900 --> 02:38.990
And I'm going to take audio manager and apply overrides.

02:38.990 --> 02:41.240
So it will be changed everywhere.

02:41.240 --> 02:42.680
Now let's go to play mode.

02:45.300 --> 02:48.420
And oh, this one sounds much better.

02:48.420 --> 02:50.580
So soft, I like it.

02:50.940 --> 02:55.800
Now they were sounding good, but they felt very similar.

02:55.800 --> 02:57.750
And it can be okay.

02:57.750 --> 02:58.140
Why not?

02:58.140 --> 03:03.420
Like, I don't mind, but sometimes it may be irritating to hear the same sound again and again.

03:03.420 --> 03:06.120
So there is a trick to make it work.

03:06.450 --> 03:09.300
Um, with the advantage, I would say.

03:11.090 --> 03:18.410
Over here, we can add a random pitch to the sound effect and let me explain what the pitch does.

03:18.440 --> 03:21.260
Let me go and find this pick up sound.

03:21.260 --> 03:23.570
I'm going to enable loop and play on awake.

03:23.570 --> 03:27.860
So it's going to be played constantly okay then in the play mode.

03:28.830 --> 03:31.290
I'm going to take the pitch value and I'm going to change it.

03:40.200 --> 03:44.460
So pitch defines how fast a sound played.

03:44.460 --> 03:47.580
And if you make it faster, it's going to sound a bit higher.

03:47.580 --> 03:51.690
If you make it slower, it's going to sound a bit lower.

03:51.690 --> 03:55.080
And because of that, it can sound differently every time.

03:55.080 --> 04:03.330
We just need to do a suffix with a suffix to play dot pitch equals to random range.

04:04.760 --> 04:10.460
And we need to give it some small difference, like from point nine F to 1.1 F.

04:10.490 --> 04:10.940
All right.

04:10.940 --> 04:11.810
Just that.

04:11.810 --> 04:18.470
And also I want to pass a boolean here bool random which is going to be uh.

04:19.490 --> 04:20.810
True by default.

04:22.210 --> 04:26.740
And I'm going to do this if random pitch, then I'm going to play the sound.

04:26.740 --> 04:33.280
But now if you want, you can disable random pitch for different sound effects just by doing comma pulse

04:34.120 --> 04:35.710
somewhere like here.

04:35.710 --> 04:38.020
For example, you could do comma pulse.

04:39.110 --> 04:39.710
Yeah.

04:39.800 --> 04:45.890
Now we did random pitch for sound effects, and let's go ahead and listen to the sounds again.

04:50.940 --> 04:51.090
Oh.

04:51.090 --> 04:51.690
I'm sorry.

04:52.200 --> 04:55.710
Uh, let's go here and uncheck play on Awake and Loop.

04:55.740 --> 04:56.460
Okay.

04:57.690 --> 04:58.800
Let's go again.

05:00.780 --> 05:02.100
And I'm going to pick them up.

05:04.480 --> 05:09.580
And it sounds a little bit different every time, which I think is really nice.

05:09.610 --> 05:13.090
Okay, so the system is working.

05:13.090 --> 05:14.020
This is good.

05:14.020 --> 05:17.560
Now you can go ahead and set up other sounds by yourself.

05:17.560 --> 05:22.150
Just go like to the death function call the death sound and so on.

05:22.150 --> 05:23.470
Or you can wait for me.

05:23.470 --> 05:26.110
I'm going to show you how to do that in one of the videos.

05:26.110 --> 05:27.820
Or should we do it right now?

05:29.790 --> 05:30.240
Yeah.

05:30.240 --> 05:31.320
Let's do it right now.

05:31.320 --> 05:31.740
Okay.

05:31.740 --> 05:32.460
Let's do it.

05:32.580 --> 05:40.410
Uh, this sound, this sound has index zero, and it is called when player dies inside of a die method.

05:42.480 --> 05:43.080
Day.

05:43.080 --> 05:45.660
So I'm going to do audio manager.

05:48.940 --> 05:50.050
That instance.

05:50.260 --> 05:50.800
Um.

05:53.920 --> 05:55.270
Um play SFX.

05:56.890 --> 05:57.610
Zero.

05:58.430 --> 06:01.430
Then we have enemy kicked.

06:01.430 --> 06:06.170
So that happens when we kick the enemy and we can do that.

06:07.160 --> 06:07.700
Give me a second.

06:07.700 --> 06:08.900
I need to think.

06:09.290 --> 06:11.090
Where do we kick the enemy?

06:11.660 --> 06:13.610
Handle enemy detection here.

06:13.610 --> 06:16.760
So we're going to do audio manager dot instance.

06:16.760 --> 06:20.090
Play SFX with one, if I'm not mistaken.

06:20.850 --> 06:21.840
Let's go back.

06:22.910 --> 06:26.360
And the finish line when we finish the game and there is a jump.

06:26.360 --> 06:27.860
So number two is finished.

06:27.860 --> 06:29.390
Number three is a jump.

06:29.780 --> 06:32.240
Let's go to the checkpoint.

06:32.750 --> 06:33.920
Finish point.

06:34.770 --> 06:39.330
I'm going to do audio manager dot instance play suffix of two.

06:41.630 --> 06:44.450
And for the jump, it happens on the player.

06:53.800 --> 06:58.690
Not in a jump button because jump button can be pressed, but there is no jump, so we need to do it

06:58.690 --> 06:59.710
in the jump.

07:00.220 --> 07:02.590
I'm going to open curly brackets for this one.

07:04.040 --> 07:05.540
And the audio manager.

07:06.540 --> 07:08.850
That instance, play a suffix of.

07:10.930 --> 07:13.780
Three and same goes in double jump.

07:15.560 --> 07:18.410
Or you can have a different sound for double jump if you like.

07:18.410 --> 07:19.970
You can use different sound for that.

07:21.290 --> 07:22.130
For the wall jump.

07:22.130 --> 07:24.560
I think I found the sound for the wall jump.

07:25.800 --> 07:26.940
Number 12.

07:27.980 --> 07:31.160
Uh, you would only have to go and adjust the volume on sound effects.

07:31.160 --> 07:35.720
And I cannot help you here because, you know, you might have different speakers, or I might have

07:35.720 --> 07:37.220
it sound differently from yours.

07:37.250 --> 07:41.300
And even if I show you my values, they will be different from what you need to have.

07:41.300 --> 07:42.770
So that is on you.

07:42.770 --> 07:45.200
You need to decide on the volume of sounds.

07:45.200 --> 07:46.670
Now there is a respawn.

07:50.440 --> 07:51.400
Respond one.

07:53.360 --> 07:54.200
Respond to.

07:54.990 --> 07:56.310
I'm going to use number two.

07:58.600 --> 08:00.280
And when we respawn, the player.

08:04.100 --> 08:07.130
Let's call it when we are ready to run.

08:07.400 --> 08:07.760
Right.

08:07.760 --> 08:09.170
So I'm going to go.

08:11.030 --> 08:12.260
Respawn finished.

08:13.700 --> 08:19.130
And if respawn is finished, I'm going to do audio manager dot instance play suffix of number.

08:24.390 --> 08:28.080
What else player is damaged number nine.

08:28.080 --> 08:32.010
So this will happen in a knockback audio manager dot instance.

08:32.010 --> 08:34.140
Player suffix 11.

08:35.500 --> 08:36.130
Uh oh.

08:36.130 --> 08:36.400
Sorry.

08:36.400 --> 08:37.000
Nine.

08:37.000 --> 08:38.350
Number nine.

08:40.430 --> 08:41.810
And we have pickup.

08:41.810 --> 08:42.620
We did it.

08:42.620 --> 08:45.200
No money is when you cannot purchase the skin.

08:45.200 --> 08:46.280
We're going to do it.

08:46.700 --> 08:47.810
Uh, jump is done.

08:47.810 --> 08:48.560
Finish is done.

08:48.560 --> 08:49.100
Enemy kick.

08:49.100 --> 08:49.430
Okay.

08:49.430 --> 08:50.750
Only no money sound.

08:50.750 --> 08:55.940
And if you don't have any other sounds in the game, like maybe you want to play sound when fire is

08:55.940 --> 09:00.920
burning from the trap or anything like that, you will have to find sound by yourself.

09:00.920 --> 09:04.520
I'm going to show you how to find sounds, but there it's on you.

09:04.520 --> 09:04.850
All right.

09:04.850 --> 09:06.200
I trust you can do that.

09:06.200 --> 09:09.260
And that is the place where you're going to be creative.

09:09.260 --> 09:12.080
Okay, so let's, uh, improve, I mean.

09:14.420 --> 09:16.700
Implement the no money sound.

09:18.170 --> 09:19.760
On a level selection.

09:24.210 --> 09:25.710
Over here somewhere?

09:25.710 --> 09:26.310
No, sorry.

09:26.310 --> 09:27.180
No level selection.

09:27.180 --> 09:28.290
Skin selection.

09:30.360 --> 09:33.000
We can return false if we don't have enough money.

09:33.030 --> 09:34.590
It happens over here.

09:34.890 --> 09:38.970
So I'm going to do audio manager instance.

09:39.330 --> 09:43.170
Oh wait this will buy skin over here on the manager.

09:44.430 --> 09:47.160
Instance, play a suffix of.

09:48.230 --> 09:48.830
Um.

09:51.610 --> 09:52.750
Number six.

09:54.260 --> 09:58.370
And I think we can play sound when we successfully purchase the skin.

09:58.400 --> 09:59.840
I have a sound there.

09:59.870 --> 10:01.910
Audio manager instance play.

10:03.240 --> 10:05.040
Instance player suffix.

10:06.770 --> 10:08.330
Of first respawn.

10:08.330 --> 10:10.610
Let's let's use this sound.

10:12.090 --> 10:12.690
Yeah.

10:14.160 --> 10:15.030
I forgot the number.

10:15.030 --> 10:15.630
Can you imagine?

10:15.630 --> 10:17.490
My short memory is killing me.

10:18.120 --> 10:18.960
Number ten.

10:19.920 --> 10:21.930
Okay, so this is good.

10:22.410 --> 10:26.610
Uh, sounds supposed to be working fine, so I'm not going to even check them.

10:26.610 --> 10:32.190
I will adjust the volume, but most of the time I'm going to enable mute mode because I'm recording

10:32.190 --> 10:33.300
and I need to hear myself.

10:33.300 --> 10:35.250
And it can be destructive.

10:36.080 --> 10:36.620
Yeah.

10:36.620 --> 10:37.490
Okay.

10:37.490 --> 10:38.690
This is good.

10:39.410 --> 10:41.330
And let's go to the next video.

10:41.330 --> 10:42.470
I'll see you there.

10:51.450 --> 10:51.780
Hmm.

10:51.780 --> 10:53.370
What is this error?

10:56.100 --> 10:57.930
I doesn't have skin manager.

11:01.370 --> 11:03.890
Okay, guys, I'll see you in the next video.
