I want to trigger a sound once!

I am having some trouble, I want to make a trigger so that when the player walks through it, it will have a x% chance of playing a sound, but only playing the sound once. I have been searching all over and am getting frustrated to see a lot of people putting in codes and afterwards write (untested) so when i test it and it doesn’t work it’s frustrating and wasting my time. Also a lot of the scripts I have been finding don’t even work at all.

Someone please help me, I have been going at this for hours with no luck :confused:

1 Answer

1

Have a look at AudioSource.PlayOneShot.

–David

Was away sorry, but got it working, thanks!

–