Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In the previous section you should have been able to download a folder
Sound effects that we can use if you don't want to use this sounds you definitely don't have to but they're going to make life a lot easier for you
Go ahead and just paste in
This folder called sounds
In to my explore in the route
And my assets folder
So in this folder we have 8-bit sound effects that we can use so we'll get a job
Unity this should import properly for us might just a little bit
I can see hear the sound effects imported into unity and there are some
Tracks with the music as well that were imported and these are by a band called by forever
And if you guys are interested in using this music you can definitely a tribute by forever images
Do your best at weed on social media let people know
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
To buy forever isn't just do your best I guess pay him back
With some exposure that would be awesome great music from bye forever
And is also some other side effects your other than just eat it sounds
For example like the player getting hurt
Health
A box breaking
Does Canesten effects
Ok so before we start adding sound effects to our player what we need to do is create a new script
And district I'm going to put it in my car and it's going to be cold
Animator functions ok and is just going to be functions we use
Over and over and over again and we can use these functions inside of a timeline other animations
So in order to start playing sound effects
We want you something called in audio source and audio source is basically
Honestly it's just a speaker that plays sound effects out of it when you attach these speakers
Game objects so originally we had a audiosource attached to our play
And I really don't want one on there so go ahead and remove that one
I'm going to do is create a new empty gameobject a minute call this SFX audio source
Another game object
How many call this
Music audio source
And then I'm going to create another
Empty gameobject in recorders ambience
Just like that
Each one of these are going to have audio sources on them
Just like that
Like that
And just like that so we're going to run our sound effects through the SFX audio source
Music to the music audio source
And then are ambience
There a beings are your source
Go ahead and save that prefab in the next thing I want to do is just go ahead and get rare
Oliver's audio sources
Does double click on new player go up to our
References section here
And I'm gonna go ahead
And I was gonna put him right here
Create a new serializefield
Going to be private or public
Public audio source
I'm going to call this as affects audio source
How to copy this and paste to more
This was going to be music
This one will be ambience
Save those out
And go back into unity here
And all I need to do
Is jumping I prefer Peter and just drag
SFX audio source
Music ATOS
And ambience audio source
Are we going to save
The next thing I need to do is create a script that will tell those are your sources to play a specific
So I know that my animations are going to
Dictate a lot of the sound effects so for example the footsteps
Addicted by when my feet touch the ground
The Punch effect is going to dictate whether a sound effect should be played when we punch
There's a lot of sound effects that can be controlled
Actually buy this animation window in here that's called add event
What allows me to do is actually fire certain functions
At certain locations
On my timeline so if I really want a blink sound effect
I can add this little dance here
Entitled to fire a certain function
Well where are we going to store
Does functions in your script
Am I going to call it
Animator functions
Double click on that
Unable to create a new function
That's right summer commented code here how about
Play sound effect
Tell me the
Void play sound
And I'm going to
Rate EuroMillion new player
Dart
See hear instance
SFX audio
Play
Now we got to use one shy
Basically play One Shot is a little bit different than just play sound and it's actually look that up
What's a couple of play one shot means on unity's documentation
Plays an audio clip in scales the audio source volume by volume scale so we can actually play a song
Expect at a certain volume right
Are you serious play One Shot does not cancel clips that are already being played so
That means that I can play an explosion sound effect in that I could play a debris sound effect by using play Once
So we can apply once what are we going to play well we need to indicate what we're gonna play so let's go back up to the Top Gear
Play new serializefield
And we're going to write
Audio clip
Sound
This is going to be private forgot that private so is going to play
Sound
Very simple
So let's go back in the unity here
I'm going to open up my player original prefab appear
And
I'm gonna go ahead in drag my animator functions
I component
Auntie with the player variant
And all we got to do is indicate what the sound is that's going to play so let's go ahead
Create a punching sound ok
So let's find the point sound
Here we go let's see here
Miele
Here we go punch
What's a syllabus first
Yeah I think punch one is just fine
Soap
Punch one is now in a sound effect
Variable here
Now I got to do is go to player kick
Add an event
And there it is
Play sound
So it should play a sound effect through
This SFX audio source and hip
Perilous
What's go ahead and add
That sound Effect 2
Everything b
Kick the Hazard
Can you kick down
Play sound
Kick punch or player punch
Play sound
Play a punch up
Play sound
No I really didn't like that sound so let's see if we can find I don't know a better one
That's kind of course I like that one
Let's save this out and because we added events to Oliver animations we should get a sound effect on everything
Action
There we go
Now if you wanted to get a specific sound for various punches so let's say if we punch in the everyone to be
Sound energy kickdown wanted to be another sound
There is one approach that would solve a problem would you actually create a premature here audio clip
And say could be called sound mate and we can remove this
So if we go back in a unit here
Go to player and then go to our animations here and go to player kick if we select our event
You're not as we now have the ability
To change the sound in a parameter
So I could put in punch to hear
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
I could put it in
Punch 3 here
I could put it in
Dagger sound there I don't know I can put it in
Swords around here
Do that so I have play
I have all these different sound effects
That we can use
Now I'll be honest though
I'm going to go a different right here you guys can go that out if you want but there is another way to do this
And I've been
Guess criticised for this method because
It's not as fancy right it's not as clean but it just makes it easier in a long run
So what I'm going to do is instead of having them on every individual animation like
Yes I'm going to actually have them in individual functions on the train explained
If I wanted to change the sound effects
For the pint
I have to go and everything animation in swap amount like this
See that swap out the sounds
I really don't want to do that what I'm going to do is Amanda going to go into my
Scripture
And I'm going to create
Annie serializefield
And I'm going to create a very unprofessional looking variable
Ennis called
Sound one ok and is going to be private
Very very trust me this is very unprofessional but this a bit
I think a decade and I just it's cleaner for me it just works way better when you have someone
Santa Santa I sound for
We can go as high as we want it's not the cleaners method but it's easier in the long run
I have the ability to play
Let's see how about it
10 sounds
So we have the ability to play 10 sounds when were using this script
Along with her animator
Cell
This function will be Coldplay someone when I'm going to have any Predators and all got to do is just
Sound one
Just like that do that
And we'll have it so play sound effect one actually was going to remove this because I think it's pretty obvious that
Appoint what this is and then I'm going
To create 4 functions are enough for 10 functions
Bare with me I know it's messy guys I know it's messy
Play sound wine place onto PlayStation 3 PlayStation 4
5 6 7 8 9 and 10
So
The name at the numbers going back up here
Here we go
Alright so now we have the ability to play 10 different sounds and I can manage all of them
Right here and hey let's make it even cleaner remember this header attribute be used in other scripts
Inside a bar
Anyway the functions are animal called this
Sound
Bank cheque
Go back to your player here now we have the ability to play all of these sounds
So somebody you might be taking what time is label them
Will it like hitsound punch down KitSound breakdown jump sound well the reason I'm not doing that
Honestly I want to see all the user's animator function script all over the place not just for the player
So having the sound effects just label it sound 123456789 10 actually
Light more economical we can use this in a ladder different places
What the question is Walter not labelled how do you know where to go or what I would do is just think about the very sad
Ok I know I want a pint sound
I know I also I want perhaps see here she want to different punchestown
So two points sounds I know I might Wanna Hurt sound so something like
Is negative sound here that's unsound three
And I also know that I want to be a health sound so more pass
The sound something like
Mariya this one I hear ok
So now we essentially have labels right when I go ok will let her punch
Tata punch
That's an error sound in a power up sound so everyone to change him I can't really like that power up sound
I know that that's right here so I would just swap it out
Where is it with another positive sound so that one
That's how I do things guys you can do do this in a lot of different ways but
This works really well for me again I can swap out all of this sounds really quickly without being
Why did dig into every animation it doesn't look professional
But it works for me so I'm gonna go to my kick here
And always is going to be is place and 1
Kick down going to be place on
Good that's my place aren't you
MN punch is going to be placed around 1
NN12 8up is place out of wine as well
I was trying out
Getting a bug animation event play sound on animation player punch
Has no receiver are you missing a component
Going to each one of our events
Looks good
Ok so looks like kickdown didn't apply are function area ok
Ok
You make sure you get a click on it guys there we go ok make sure you really click on those events otherwise it won't remember
Play someone and then punch up
Play Garnett area play Someone
Double check archaic here
Ok good I really straight out
Alright
Alright it works great
Alright so we've got all those sound effects playing for punching and when we create you know some
Step sound effect this is really going to make things pop guys
So let's find a very simplistic sound so do I have any
Sound effects
I see you have a generic
Impact of trophies
None of these really work for me so what I'm going to do is go to freesound.org ok
Play times of free sound effects and goes all you've got to do
Is just make sure you treat the individual who put the sound on the website so I will look for a
Footsteps sound
No I wanted to be that nice crisp
Nope
Nope
I like a light that's great really download that sound
Alright so thank you in Spectre J whoever you are for this sound effect
I mean I open it up in a program called audacity guys audacity is free if you want to go ahead in
Oh that's totally fine there's a link in the previous section
K
That's a cool sound and I'll take that one
I'm going to crank up the volume a like all my volumes to be right between -12 and 6
Crazy I'm just a little bit more
There we go
So I'm going to
Happy this single sound press ctrl-a
Delete everything pasted in
I'm going to
Just faded out like this
And again that's just highlighting this
Including fadeout in the effects panel
I'm in export this out as a wave file you can do an MP3 if you want as well
Anyway to save this in my sound effects file this in my effects folder and I'm just going
Call this step
Footstep
How about stone
1
Ok just got back in the unity here and I'm gonna go to my player and they go to
My sound 5 year I'm in a drag
Let's see where is it there is a dragon right here and I'm going to go to
Player run
In every time is foot touches the ground
Sorry here
Australia here we go I'm going to go place on 5
Save it out
Limited play The Heart sounds
Ok so as you can see it's very loud for one
And it's also very innocuous will it solve the loud portion first
Go down the sounds five here in just for the purposes of this tutorial I mean
Type in
Float and then volume
There we go and then what's right here is fine so this is the second parameter of PL1 shy
In basically now we can determine
What we want the volume to be exactly
4 sound 5
And I might be a little bit confusing just to show you how it's going to work to get a player here
Turn around
Click event
And then we have a friend here
So this is going to be .3 having that works now they wanted to default
To a certain number we can do this equals 0.3
Default it to one I think that might be better option say that
And
Go back in the Unity
And multiply
Good
Awesome not obviously guys you could instead of doing it here we can use that's a man
And put it all up here
As well so I could say something like
You can't be this
United's a private float sound 5
My
Say that out and then remove this
Dubai player here
Now I can see
The ability to change sound 5 volume so I can do .3 in honestly I prefer doing it this way
And I know it looks like professional I get a guys but that's the way that I'm going to do it because I know how the
Text me long-term this is actually a really efficient way so I'm going to create a tonne of different sound
Buy the fault beneath the one right
By default they need to be wine
Otherwise
They won't play it all because they'll be at 0 and we don't want that
That's a really like this method of playing sounds because
He just intuitively makes a lot of sense it may be messy
But it makes a lot of sense
And I like that UK
Alright
So we just put in our volumes into the primitive here
Someone volume
Sound to volume
Sound 3 volume
Alright
Very good so now we have your belly to play 10 different sounds at 10 different volumes
Came
So if we didn't like the punching volume we could actually tweak it right here
If we don't like the power of boy we could speak it right here
Overall
This is actually a really great way to have the ability to quickly change sound effects
Alright so yes bro I having trouble hearing that just cause it's a very saddle
But you definitely want your running to be a saddle sound you don't want to be annoying
One of the things that's making it very annoying right now is that it's one sound over and over and over again
So what we're going to do is going to have three different sounds for a run ok
20 is this one
That was gay and copy that
I just have it pasted individually here
Shrink the volume down just a tad here we go
And will export this one out
As the second footsteps same syntax but just second
And go back in time here
That was a game
I copy that one paste it
Feeder
Ok and
Chanel there we go
Export that one out as a wave in the third sound effect
In letters import into unity there they are four step one
Footsteps John 1 2 and 3
Telescope hit play here and see how it sounds
Sounds pretty good so sound 5 is set to the right volume I don't mind it at all
But
Is kena repetitive isn't it
So we're going to take those
Three sounds that we made 4 stone 12-in 3 and we're gonna try and play those randomly
Now you can see sound five only offers
Nice one slot
Are we actually have it off three slots and pick one at random
Do I need a jumper in a minute functions and we're going to use something called in a ray
Are we going to do to create an array is two brackets
Next to our sound 5 variable to do
Understand 5 and you can see here we now have a little zig zag that's because we're saying hey
Play sound five the Promise is that well you really doesn't know what sound 5-years because
It's an array in array allows us to have an array of sounds
A tonne of different sounds ok moholo
Does Commodus out of the quick
Can I see when an array looks like in the unity inspector
So this is in a right here truly it's size is set to zero but if we said it's eyes 23
We now have the ability to add 3
Clips
Ok so I could drive those in
Well we're still going to get those errors
Because unit is confused it doesn't know what soundtrack is he needs to be told which sound
5 from the array to use
And you can tell which slot to choose so look we've got
0 or elements 0
Element 1 and element 2
So I can actually say I wanted to play sound too
Ok
Say that now you're back in the universe here and hopefully
But it's not playing random sounds because we told it to play element to how do we have it
The random
Element
Very simple actually going to do here
Is
Save this
Random range
Apprentices
Wigan starting 0
And then we're going to end
At 3 they make sense
To all this means is play sound 5
And in the brackets mean inside the array there are three slots
Choose a random slot
Between 0 and 3
So we hit save
Jump back in the unity and hit play
There we go
No you're not that I actually made the incorrect assumption here
It's not going to be free
Going to me too
And the reason why is because we started 0 we end it to even though there's three elements
We start at zero that's the way to raise work they always start at zero
Save that out
Or a better way to do this
Just to be sure we always get the right length so for example if we had 10 footsteps sound effects
I don't want to have to go back into my script
And make this a 10k
Do we solve that
Is my simply typing
Sound 5 length
So 02
10 because he's going to find the length
Of the sound 5 array
Put in this case when going to 3
7 hour
And then we can apply
That's great
Awesome
Ok
Very good I like that a lot so we're gonna use that kind of magic for every single
Explain something like quickly just because it's in a raid does it mean we have to use multiple sounds so for example
Would sound one if I use that same logic
Made in a ray
And I used this same
Search of equation here
I copy that paste it up here
Change the sound one and then someone that likes
What happens if only have one sound forgot to someone here set the size to 1
And then put in the Punch sound effect
And then we play
It's only ever going to play that sound great so it works with
Single sound or as many sounds as you want right so technically we could actually put in three sounds here
And you all sorts of sounds we could do a punch to
And a punch 3
Hipley
So we're going to play about logic
To every single variable
The first step
Just go down all of my variables here and I know this is redundant guys you really want to avoid
A redundancy you really do but I found
Again I can't say it enough I'm going to be redundant with this specific script which is animated functions
Because
It's so helpful long term and keep things really organised so I'm gonna keep it this way
And I'm gonna go ahead and go down here
I'm going to do is copy this
Emirates space it every single one
Here we go here we go
And then I'm on my way back up
I'm gonna change this to 10
9
87
65
Igo4
Free I want to do a countdown
2
N1 alright
So that looks great
Everything's ready to go
Show back in the unity and see how everything works
Alright as you can see because we converted the individual audio clips in to erase
We have to go ahead and reset the sounds ok so we're going to set the size
4 sound 4 and 3 alt 1
How much is it to go through and take a look here kick
That's place and wine kickdown is place onto ok so please don't want to setup play sound to it
So that's going to be
Punch for
I like that sound effect do we use Sound 3 at all let's take a look
We do not use Sound 3 currently so it's go ahead and said at the jump right so jump we could you
Sound 3
And then the player here and let's see here
Sounds three we could have a jump sound
So let's see her let's do a
Let's find a call sound
Positive sound
Nope
That's a cool sound I like that one
So we're going to strike then to sound 3 here
Ok something I also can do in player jump and it said that out and
Hit play I know this sound is going to be a little bit too loud so when I get .4 and I'm in here play
That is so weird
Oh my goodness
Let's not game
Says he can see the jump sound is playing all the time
Does anybody know why the reason is because as I sometimes just
Nearly fall just barely fall that animation will start playing see that we definitely
So we're going to do is going to a player animation
Go to jump here
And we're gonna make it
Move over
To about right here here we go
The jump sound or happen red deer ok let it play and see what happens
Ok
So let's go back to a job and maybe bring it over just a little bit about right here we'll see if that works
Alright
Ok so I don't really like it the reason why is because the jump
Animation starts
First before I even fall ok
So let's take a look here
The player jump always happens first before going to play awful
And that kind of
It's definitely simpler
But it's causing some problems
So what we going to do is go ahead and go to a train station here like a new transition to playoff all ok and then
What we're going to do is make sure that are grounded is false
The players are going to jump if the velocity
Is greater than
.5
Is greater than .5 he's certainly going to play that jump animation otherwise
What is going to play
The Fall animation
Let's try that out and see if it works
Actually no yeah
Not yet
Just want to make sure that there's no exit time and the transition duration is PT 1
Play
It's still playing the reason why
I see the reason why is cos we're going back to play a jump
If grounded equals true
In honestly really don't want that song and I just remove this entirely
And I'm going to do it this way
Here we go so if grounded equals true immediately go back to playlist and no exit time
No transition Direction
There we go ok
That should do it guys
Still happening but take a look and see what's going on do you ever getting in a
Using the Glitch like this it's good to have your animation window
Are you in a major window right next to game window ok let's take a look
Ok
Is still going to play a jump for some reason why is that
Let's take a look here
So what's player stand
And when we fall
You should be able to play Age of Empires on cigarettes
I see it because we're running so we are
I need your address this right here because they were running we can go to the player jump and that's not good either
Sort by
Is less than
Greater than
.5
Say that doesn't make sense guys it's all just sort of a big puzzle at this point trying to figure out
Which goes to White and why
What's a play here
Alright
Now we need to have the same
Transition to play a fall as well
There we go
And so same sort of mentality here from stand to fall if ground is false
And velocity why is
Smaller than
Negative .5
Then go to playoff all right
Then
Same mentality going back right which is grounded = true
Grand Eagles true go back now the problem is we have to interfere in transitions so that's all we need to say
If
Velocity x
Is lesbian
Point
3
Go back to play a stand
Velocity
Direct
Is
Greater than .3
Go back to raw
No exit time needed
But either of those
Yeah and that's it here
Pretty fast transition zero fine with me
Hello finally guys
We also want to do is just make sure there's no exit time we're going to fall
Sub-Zero that out
Cleaners up there we go outside a bit clearer I like that
Crawley
Something like this spring these up a little
So that there's a square here that's very pretty I like that
Ok
What's a little bit better
Let's play here
And take a look
Good
Very reactive I like it a lot it's a little bit snappy When I Fall so
Ariel it's actually make this not so fast straight so play Run 2 player fall can be something
1 a.m. player standard player fall
That's ok play 0.1 is good to you so straight out
Awesome
Alright guys so it looks like a jump sound is working just fine
There's a way to make you jump feel just a little bit better ok just a tiny bit better
I like to do is side my player got a player jump
And
Make a sound effect
For two feet touching the ground ok so you're a player here
We know that sound 5
Does all about footsteps something bad
One play sound via another one
Right here
So tell me to fourth king the grand
Australia now hopefully
And I'll tell you I really don't like the volume of that jump sound so we can just really bring it down
Play smarter Lake
.1
That's fine
I wonder if we could find a different sound to be honest cos that sound is just weird I really don't like it
That's kind of fun I like that I don't know why but I like it funny I like it a lot
Ok let's play
Ok so some of you might be wondering
When you actually
White to play a sound outside of the animator ok are you why we might want to do
As I'm running here
And I hit things
If I sort of bounce off something it's going to play
That sound
And even I don't press the spacebar right so something like
Let's see her something like this
Yeah
Ok
So let's create a false sound now
Let's see if we can get a grant from a male voice actor
Male grunt
Tell me download it
And hopefully we can open this up this is an aiff
And hopefully it'll open up inside of identity if you're having trouble opening this app to open with
Audacity
Hopefully at work
That looks like it doesn't work for me
So we can have two sounds
This one
Has a jump sound
Alex sounds great let's export that what you do is export selected audio
What is going to be
Jump Mail Grant
So now we're going to add a Grunt sound effect for the jump as well
So let's go to sound
4 years ago not using the slot for sound for
So let's see if that sound actually imported
Jump Mail Grant
Scared
Yeah there we go and then go to a jump and
Honestly
We can put it right about here first
And we do play sound for an umbrella drag this over on top of the others to hear the reason I had
Because it's sometimes hard to select it too
There we go that's great
Alright just a little little wild
10-minute Street down the volume to 8.3
Ripley
Alright
Still well aware I'm going to make it really settle
Hammer 0.0008
Now there is sometimes when you don't want to play a sound using are animator functions
Self example the coins here
When collecting a coin do not really being animated are they and there's no real animation that occurred
When you collect
The Collector budgies disappears
So we can do is actually just go to the collectible here
Double click on the script and very easily
Just adding
Sound effect
To play
When is collected
So we're going to put it right here
During the collision
The object
We don't have to put it inside of any of these if statement here weather is a coin l2m or whatever
Play the new player that instance
SFX audio source play one shot
And then
Collection sound
And also
Collection sound volume
Tower Pier
In Adam good job good thinking serialise
Field
And then I can be a private audio clip
And it is going to be called collection sound you guessed it and then also we're going to copy this paste
Where to do a float and then we're going to be collection sound in this by default is going to be one ok
Now we also need to make sure that we check to see if this is no ok so we need to say if
There's even a collection sound
So if collection sound is not equal no
Then play the collection sound another way of writing this if statement is
Just saying if collection sound
That's about it
So now we're going a unity
And hopefully the point of using prefabs is becoming more and more clear now
If I wanted to add a sound effect to let's say
Are coins if I didn't have prefabs I'd have to drag a collection sound
So let's say it's going to be this down here
To every single free verb and I would go crazy right and then I'll quit making
Forever so let's just click the arrow in jump inside of a prefab
How we can simply add in that sound effect
So which one we like this coins will see her know
Cannibal sound selling Mario so I'm going to do that
Clutch and sound of 3 and a 1 and 3 so loud 2.4 is good let's say that out
And see how it sounds to play
Awesome
See hear
That's great I like that
Not say anything guys we could actually have some kind of random volume as well so it doesn't sound
So static and on variable all the time
So we can do is actually x the collection sound volume by a random range multiplier
Right we could do .8 f and then wine PT 4F so what's going to happen
Multiply the collection sound by 0.80% of 1.4
If that makes sense
In another princess is here and we got ourselves a nice sort of random sound
Volume
As reflecting these
Awesome
Very cool I like it a lot let's treat that volume down just a little bit more 20.1
Can't let it play incy I sound
There we go
Much better
Ok so we've got some sound effects for collecting our gems
So hopefully now you can maybe understand why weed want to use a collectible script
Help and 4 coins in keys even because now we can add sound effects to pretty much anything
So if we go to our health here
The collection sound
Guinness add a sound effect from our sounds
Tell something Hitler
Something can a positive phrase
Something like this
And sound can be the vine give you about .5 so that and then the same is true for this key
Right
We can also
Have a collection sound for the key
The song of Sound shows and put it over there and it's
And now we can have play in
Tester.com works
So we can decrease the volume of the health care
Just a little bit jumping over prefab
Changed about .2 and save it
It's so what about some sound effects for
Maybe our enemies as they get hurt
Wallet
Go inside of the enemy script
And by the way I'm just going to create two new
Audio clips here
And when you create a new section of this section sound effects
Hennessy here
Let's create a
Serializefield
Going to be private audio clip and it's going to be hurt sound ok
Happy there and then death sound
So we have needs to sound effects and now I need to find a way to play them correctly we don't really have a fun
Are anime script that caused the player to show an effect of getting hurt
It really happens when we hit the player is there health decreases
So what we can do is actually create a new function we're going to call this public void hurt
And
Type health - = 1
Animal play that sound effect new player that incidents
SFX audio that play one shot
NN hurt sound
Alright
So this function is not going to be called anywhere curly nothing really cause this
Function
Now it should be called remember
From the attack box Script if you can take a look the attack box
Basically just decreases the health right
So instead
Have using this script
Rihanna copy it and we're going to say enemy
Put
So now you're calling the Script here
Same sort of thing it said now we can actually play that cuts out
Also attack box if you really wanted to we can actually pass through new player
The Instance
Attack Power which currently is set to 1
Well we're getting a little bug hear it
Saying that we don't have that primitive able to us which is true if we got our enemy here we need to make sure
We put that primary there which is attack power
And by the fourth can be one
And then just said this to attack power
Ok
So now we have the hurt sound available to be played and then we also want that jet sound to be played
Which will happen
Here
New player instance SFX audio
Play one shot
Death sound
Why is it happening there because if health is smaller than or equal to 0
The first going to play the jet sound
And then we're going to destroy the object
Sorted save in trial the cell
First thing we need to do is jump into enemy prefab
Find a sound effect we like
Let's see hear explosions
We could do a short life something like this
Anna hurt sound
Could you let see hear something like that just for now and save it out
Currency
Everything is working properly
Alright so I love the explosion sound
I don't like the
Impact sound in back sounds
I don't really like any other sounds here so let's see here
Is there a melee
See if there's a better sound
That's the sound a like I love that one
There we go
Save it
There we go that's
Great just way for now
Just for some simple sounds a little bit loud so we can use the same now
We've been using this whole time basically we add a volume so death sound volume
And also we're gonna have a hurt sound volume does variables do not exist
Quite yet so we're just going to go Pier
Happy bees
We are making floats
And
Change the volume to volume next to
In by The Fall going to be worn
We definitely don't want them to support 20 cos they will be confused if we forget to set the volume
Ok
Under enemy here
And just make sure we can adjust these
Vines accordingly 2.4 that's great
NN PT 3 4 death sound sounds about right
No save it and hopefully here
Theragun
Alright so what are we going to head and figure out a hurts
For the player as well well
Northern thinking about it I know that I want the player to also show an effect
When he gets hurt
Right so what I want to do is go to my player
In a minute create a new animation
In America this player hurt
That sounds about right
Ok and I'm going to hit the record
Button
Anything what I'm going to do is I'm going to actually
Just disable
All of the graphics
Now this is
Skeletal system
And so
We don't want to see what that
But we can certainly just disable
These actual
Sprite skins so if I just
Disable the Sprite renderer well ok and then I just quickly pop it back
Basically what happened is he just going to pop out of existence for a split second right
Can also just add the sound effects so playsound six I think that I work
See her
Yeah we don't have any sounds for sex yet
Scooby-Doo just one sound
And then
Let's do a negative sound really
Painful sound too painful
That's good I like that one
So drunk that sounds 6 mate so little too loud so we're going to make a .6 k
And
That's all set up ready to go to the only thing left to do guys is just go there and M here
And you can see here
Do we have player hurt here
In what we can do is actually just go from any state
Two player hurt
So I'm in a click make transaction
So I'm gonna go ahead and right click
Cheers mate transition and there's going to be no exit time it's going to be instantaneous
So no transition
And the condition is going to be f
Hurt
Remember we created this little hurt
Trigger here
Well it's going to go to the player and then it's going to immediately come back
Two player stand
After an exit time of around .3 seconds
In a transition of pt 25 at sounds about right
How to make sure player hurt is inside the loop
Ok good save it out
And now before we finish up this little section here
I'm just going to go to my new player script
And I'm going to look at where I'm getting hurt
Let's see here
And I'm going to find out where we can fire this well I know when I go to my enemy here
I'm touching the player this enemy is touching the player
Ennis collision function
We can see here that we have a few lines of code that are occurring
So when are we just combine all of these for copying and delete them and they just go new players that are insane
Hurt right
And then we can go to the new player
Ring create a new
Function public void spirit
Pay scales in any way when we just go ahead and go animator set Trigger
Hurt
Hopefully
That'll do
Celtic play here
Let's get hurt
Oh better ok good got her again so I think it's working
A few issues with a collisions though
Works just fine
Ok so we can now get hurt by the enemies there's a couple of things that will need 8-week there to make it a little bit better
So fireworks just fine
Hand
How to do that really hurts
Ok
So far so good
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.