Thank you so much for this! I've been struggling for days as an absolute newbie and this was so straightforward and FINALLY helped me to trigger sound! Wish I could like this video 100x
Time consuming is important. If you look for this method for months, how much time would it likely to take your time to make one game , 5 years ? or whole life? P.S: Find It in 2 minutes.
This is perfect! Just what I was looking for. Was doing it wrong at first, and realized I had typed something wrong, but works perfectly when you do it right!
Thank you!!! I've been looking this for my music production project for video games but I didn't understand anything about it, you saved me the semestre, thanks! Saludos!
hi there. i have ZERO knowledge on coding and i just wanted a quick tutorial on triggering simple sounds in unity. however, when i am writing these exact lines in my visual studio, apart from "void" and "public", all other text i write is just a plain black letters. no keywords/tags jumping on me like in your video. after i write "OnTriggerEnter" - it just stays like that and no "collider other" ever shows up. so... erm. what do i do?
Hi ! In visual studio why isn't suggesting me the references as yours? the only one that works is public; the next ones such as audio source doesn't come up. Thank you for your help
Assets\FPS\Audio\SFX\TriggerSFX.cs(8,12): error CS0246: The type or namespace name 'Audiosource' could not be found (are you missing a using directive or an assembly reference?) How would I fix this?
Hi there, I followed all the steps in the video but no sound is playing when I move my player onto my trigger sound object. Wondering if there is anything I need to add to my player script, or should be adding something like CompareTag("player") into the OnTriggerEnter in my trigger script? The 2nd question I had was why you added the sounds to the player rather then on the tigger objects themselves? Thanks for your tutorial.
Why put the sounds on the player object rather than on the trigger objects? Seems like you'd get the potential for spatializing it if you place them on the triggers themselves.
@@JonJonGames I dunno, one sound per trigger object seems pretty simple to me, plus you get more functionality. It's more modular, etc. You can more easily use prefabs if you need multiples, etc. I was wondering if Jimmy had some performance reason or something. I think his tutorials are great, but just wondering about the reasoning on this one. Maybe he'll reconsider...
I agree. ANY of my sound effects emit from the object/trigger. i am not loading up my character with 1500 sound files (my character doesn't care about birds, frogs, or insects when it enters a swamp). I'd rather the object that makes the sound be responsible for the sound. As far as spatializing, technically, if your character triggered the sound, it would emanate from your character.
Hello hello, I followed you tutorial and it doesn't seem to work for me. Initially when the sound was 'play on awake' it works, when I uncheck that to have it as a trigger, I don't hear the sound effect when I run to the box. What am I missing? I really appreciate the tutorial!!!
hi, I have a question I want to destroy the element and add a sound ( like guitar pro) but, when the element is destroyed the reference of the audio source is lost, how do I fix this? i have 7 cubes with different notes, so i want that the trigger destroy the object and play a note for each of them.
Best thing to do is to set the audio element on a separate object. So for example, add an empty game object, name is "Audio" and then add 7 child objects with the sound on each
Thanks for the video, really helpful! I am using Wwise to implement my audio so you may not know exactly how to translate this in script, but I'm looking to create a script to attach to destructible objects to trigger a SFX for when the object is destroyed. Would you know how to do this? I'm new to scripting so am just learning the (very complicated) ropes! XD thanks so much in advance
Thank you so much for this! I've been struggling for days as an absolute newbie and this was so straightforward and FINALLY helped me to trigger sound! Wish I could like this video 100x
Thank you...
I've been looking this for months. You're a hero.
Time consuming is important. If you look for this method for months, how much time would it likely to take your time to make one game , 5 years ? or whole life?
P.S: Find It in 2 minutes.
@@i_am_reshad hmmm wtf
@@stingandr back for you
This is perfect! Just what I was looking for. Was doing it wrong at first, and realized I had typed something wrong, but works perfectly when you do it right!
this is the first ever c# code I have ever written and its because of you will be checking out some of ur vids if I need help
Insanely simple and great, thank you for the upload!
Thanks. This was as clear as a bell. Some of the other vids out there are either olde or over complicated.
2:58 That sound that I was setting up was a jumpscare sound. gee thanks
Hey man, thanks so much for this, I've been looking around the internet for this kind of tutorial, this one's a life saver, thank you so much
You seem to be having fun with Unity 2019.1.
thank you so much for this!! amazing tutorial
Thank you!!!
I've been looking this for my music production project for video games but I didn't understand anything about it, you saved me the semestre, thanks!
Saludos!
hi there. i have ZERO knowledge on coding and i just wanted a quick tutorial on triggering simple sounds in unity. however, when i am writing these exact lines in my visual studio, apart from "void" and "public", all other text i write is just a plain black letters. no keywords/tags jumping on me like in your video. after i write "OnTriggerEnter" - it just stays like that and no "collider other" ever shows up. so... erm. what do i do?
Thankyou , helped me alot!
Best tutorial but i do have one question, wouldnt the collider cause you to bump into it?
I like these mini tutorials, thanks Jimmy
Much better than audiomanager. Thx!
It worked, you are amazing!! Thank you so much
thanks bro since they did not made Bolt futural on this i used your video fast and easy
Thanks for the great tutorial!
wow that actually worked. I like simple solutions
Hi ! In visual studio why isn't suggesting me the references as yours? the only one that works is public; the next ones such as audio source doesn't come up. Thank you for your help
Great tutorial
Big help thank you!!!
Thank you SO MUCH for this!
Easy and quick way Thank you
Assets\FPS\Audio\SFX\TriggerSFX.cs(8,12): error CS0246: The type or namespace name 'Audiosource' could not be found (are you missing a using directive or an assembly reference?)
How would I fix this?
also problem
just change from ''Audiosource'' to ''AudioSource'' and it should work fine.
Thank you !
How to make the sound work only one time ?
put in a line to disable the collider. loads of my tutorials cover disabling components in code
Very helpful, thank you :)
It worked. Thanks
Thank you for this. It really helped me. Subbed.
Great tutorial :)
hi amazing solution , thankyou. just it doesnt play in my build , wondering if you know why ?
Hi there, I followed all the steps in the video but no sound is playing when I move my player onto my trigger sound object. Wondering if there is anything I need to add to my player script, or should be adding something like CompareTag("player") into the OnTriggerEnter in my trigger script? The 2nd question I had was why you added the sounds to the player rather then on the tigger objects themselves? Thanks for your tutorial.
Nice and simple...thanks for sharing.
If I were setting this up with an arcamera as the player does the camera need a rigidbody?
Thanks it literally only took me 3 minutes
Excellent thank you for making these videos🌈🥇🏆🚀👍
thanks! helps a lot
the option to select a sound in the script when you put it on the cube, it doesnt show up
Why put the sounds on the player object rather than on the trigger objects? Seems like you'd get the potential for spatializing it if you place them on the triggers themselves.
Eric Ameres the player Object is more reasonable.
@@JonJonGames why do you say that? What if there were dozens of triggerable sounds effects?
Eric Ameres player object = Simple ;)
@@JonJonGames I dunno, one sound per trigger object seems pretty simple to me, plus you get more functionality. It's more modular, etc. You can more easily use prefabs if you need multiples, etc. I was wondering if Jimmy had some performance reason or something. I think his tutorials are great, but just wondering about the reasoning on this one. Maybe he'll reconsider...
I agree. ANY of my sound effects emit from the object/trigger. i am not loading up my character with 1500 sound files (my character doesn't care about birds, frogs, or insects when it enters a swamp). I'd rather the object that makes the sound be responsible for the sound. As far as spatializing, technically, if your character triggered the sound, it would emanate from your character.
A great tutorial!
One quick question tho, how can I make the trigger only go off once?
turn off the collider in the code when it triggers
@@JimmyVegasUnity how do you do that?
Sank you, Jimmy. 3:00 is my mistake too #facepalm
Thank u some much 😯
Thank you
Hello hello, I followed you tutorial and it doesn't seem to work for me. Initially when the sound was 'play on awake' it works, when I uncheck that to have it as a trigger, I don't hear the sound effect when I run to the box. What am I missing? I really appreciate the tutorial!!!
PlayOnAwake means it will play when the game starts. So it isn't the trigger setting it off. Have you ticked IsTrigger on the Collider Component?
@@JimmyVegasUnity It's Orla here. I didn't click is trigger, works perfectly now. Thank you so very very much!
Thanks!
hi, I have a question I want to destroy the element and add a sound ( like guitar pro) but, when the element is destroyed the reference of the audio source is lost, how do I fix this?
i have 7 cubes with different notes, so i want that the trigger destroy the object and play a note for each of them.
Best thing to do is to set the audio element on a separate object. So for example, add an empty game object, name is "Audio" and then add 7 child objects with the sound on each
Thanks for the video, really helpful! I am using Wwise to implement my audio so you may not know exactly how to translate this in script, but I'm looking to create a script to attach to destructible objects to trigger a SFX for when the object is destroyed. Would you know how to do this? I'm new to scripting so am just learning the (very complicated) ropes! XD thanks so much in advance
try adding a sound before the object is destructed
Very good
I had issues with triggering it
how do i make it so it can only play once
Is there a way to make it so you click it to trigger it instead of walking through it ?
instead of OnTriggerEnter use OnMouseDown
Nice tutorial, how can i make it sound just one time?
this.gameObject.SetActive(false);
place this after you play the sound
@@JimmyVegasUnity You're the best Jimmy!🖤
very good viedo
What if I want to trigger it by clicking on an object? pls help
I turned off play on awake but it kept playing anyway
but could you do a tutorial that if I click E, then the sound will start playing?
Search up input commands on youtube and then add the sound player to it.
when im in visual studio, the audio code wont appear
Bro you can't just 'drag and drop' sound1 into the player 2:53 ._.
Nevermind sorry you can :( GREAT TUTORIAL THO KEEP IT UP!!!11!1 the only thing i would ask is how to get the sound only to play once?
what are you talking about?
thank u!!!!!!!!!!!!!!
Sadly, it doesn't work, I can go trough the trigger and nothing happens
You won't have set it up correctly then
THX SO MUCH
Thanks!!!
how do you make it play only once
turn the box collider off after you enter it… so it’d be GetComponent().enabled = false;