1
00:00:00,000 --> 00:00:00,000
Hello, guys.

2
00:00:00,000 --> 00:00:05,000
In this video, I want to improve sound effects system, and for that I want to play another video from

3
00:00:05,000 --> 00:00:11,000
my insider course where we're doing basically the same, just it has more suitable environment for explaining

4
00:00:11,000 --> 00:00:13,000
why we're doing it and how does it work.

5
00:00:13,000 --> 00:00:18,000
But after we watch this video together, we're going to implement same system in this game.

6
00:00:18,000 --> 00:00:19,000
So let's just watch it.

7
00:00:19,000 --> 00:00:23,000
And after that, let's implement it in this project.

8
00:00:23,000 --> 00:00:24,000
It's nothing difficult.

9
00:00:24,000 --> 00:00:27,000
It's basically one line of code that changes everything.

10
00:00:27,000 --> 00:00:31,000
But still, what I'm trying to say here is just that game has different player controller and it's easier

11
00:00:31,000 --> 00:00:34,000
to explain with more control of the character.

12
00:00:34,000 --> 00:00:35,000
Right.

13
00:00:35,000 --> 00:00:35,000
Okay.

14
00:00:35,000 --> 00:00:37,000
So let's watch the video.

15
00:00:37,000 --> 00:00:37,000
Hello, guys.

16
00:00:37,000 --> 00:00:43,000
In this video, I want to tell you, how can we make sound effects sound differently every time?

17
00:00:43,000 --> 00:00:49,000
Because at the moment, if you pick up, let's say, six fruits in the row, it's going to sound like

18
00:00:49,000 --> 00:00:49,000
that.

19
00:00:49,000 --> 00:00:51,000
Wait, I'll switch of the music.

20
00:00:54,000 --> 00:00:54,000
Yeah.

21
00:00:55,000 --> 00:00:56,000
So it's going to sound like that.

22
00:00:59,000 --> 00:01:00,000
Very same.

23
00:01:00,000 --> 00:01:00,000
Right.

24
00:01:01,000 --> 00:01:04,000
But every sound has a peach effect over here.

25
00:01:04,000 --> 00:01:07,000
If you ever worked with the music, you might know what is a pitch.

26
00:01:07,000 --> 00:01:12,000
So this the sound we play when we pick up items and there is a pitch.

27
00:01:12,000 --> 00:01:17,000
So if I increase it to the big one and the increase value to really big one, just to make a point.

28
00:01:18,000 --> 00:01:20,000
And let me take my player and pick up one of them.

29
00:01:23,000 --> 00:01:24,000
Sounds like that.

30
00:01:25,000 --> 00:01:28,000
And if I make it lower.

31
00:01:30,000 --> 00:01:31,000
Not like that.

32
00:01:32,000 --> 00:01:32,000
Boom.

33
00:01:32,000 --> 00:01:33,000
You hear it?

34
00:01:35,000 --> 00:01:36,000
My comment and then like this.

35
00:01:37,000 --> 00:01:42,000
So every time it sounds differently with a different pitch and we can control the speech from the code.

36
00:01:42,000 --> 00:01:44,000
Let's go to our audio manager.

37
00:01:44,000 --> 00:01:45,000
It's over here.

38
00:01:45,000 --> 00:01:47,000
I'll do close all but this.

39
00:01:48,000 --> 00:01:52,000
And right before we play the sound, I'm going to do SFX.

40
00:01:52,000 --> 00:01:54,000
SFX to play.

41
00:01:55,000 --> 00:02:06,000
Dot peach equals to random range from point 85 to 1.15.

42
00:02:06,000 --> 00:02:13,000
Let's say it should be not really a big difference because otherwise sound will be very different and

43
00:02:13,000 --> 00:02:14,000
that's not what we need.

44
00:02:15,000 --> 00:02:18,000
We need it to sound similar but different every time.

45
00:02:19,000 --> 00:02:19,000
Right.

46
00:02:19,000 --> 00:02:20,000
Let's go and test this.

47
00:02:21,000 --> 00:02:24,000
So I'll try to jump many times.

48
00:02:26,000 --> 00:02:26,000
Where is the music?

49
00:02:30,000 --> 00:02:32,000
So jump sounds differently every time.

50
00:02:32,000 --> 00:02:36,000
And when I pick up fruits, it sounds differently as well.

51
00:02:37,000 --> 00:02:38,000
Let me make more of them.

52
00:02:39,000 --> 00:02:42,000
So it is really easy to notice.

53
00:02:43,000 --> 00:02:44,000
Now listen to this.

54
00:02:46,000 --> 00:02:48,000
Yeah, it sounds different every time.

55
00:02:48,000 --> 00:02:50,000
And, you know, these kind of things.

56
00:02:50,000 --> 00:02:53,000
What makes game really good?

57
00:02:53,000 --> 00:02:56,000
Because player will not notice it.

58
00:02:56,000 --> 00:02:58,000
I'm telling you, nobody will care.

59
00:02:58,000 --> 00:03:01,000
But people care if it's not there.

60
00:03:02,000 --> 00:03:03,000
This is how it is.

61
00:03:03,000 --> 00:03:09,000
Like if it's not there, people will notice, people will complain, but if it's there, nobody notice

62
00:03:09,000 --> 00:03:10,000
and everybody is happy.

63
00:03:10,000 --> 00:03:16,000
So details like this should be in the game to make it feel better without player even knowing it is

64
00:03:16,000 --> 00:03:17,000
there.

65
00:03:17,000 --> 00:03:17,000
Right?

66
00:03:17,000 --> 00:03:21,000
So now every sound sounds differently and you're not getting tired of the sound.

67
00:03:21,000 --> 00:03:25,000
And I guess we should make jump a little bit lower in the volume.

68
00:03:28,000 --> 00:03:29,000
All right.

69
00:03:29,000 --> 00:03:29,000
Yes.

70
00:03:29,000 --> 00:03:35,000
So as we understood, we're just going to change each of every sound effect when it's played.

71
00:03:35,000 --> 00:03:37,000
And we're going to do that by putting random value in it.

72
00:03:37,000 --> 00:03:39,000
So let's go to audio manager.

73
00:03:41,000 --> 00:03:45,000
We're going to find our play a function over here.

74
00:03:45,000 --> 00:03:47,000
We're going to do this.

75
00:03:47,000 --> 00:03:50,000
A suffix with the index.

76
00:03:51,000 --> 00:03:59,000
Then dot each equals to random range from point.

77
00:03:59,000 --> 00:04:05,000
Let's try 85 F to 1.1 F, something like that.

78
00:04:06,000 --> 00:04:08,000
Now I'm going to go and pick up some coins.

79
00:04:17,000 --> 00:04:18,000
You already can hear jump.

80
00:04:18,000 --> 00:04:20,000
Sounds different every time.

81
00:04:20,000 --> 00:04:20,000
And coins.

82
00:04:21,000 --> 00:04:23,000
Yeah, sound is different.

83
00:04:23,000 --> 00:04:25,000
All right, let's go and do the settings.

