I created an empty object and named it “soundtrigger1” Now i used the script which i found on another question.
function OnTriggerEnter(otherObj:
Collider){
if (otherObj.tag == “Graphics”){
audio.Play();
}
else {
audio.Stop();
}
}
The “Graphics” is the actual player on the First Person controller script which comes with Unity standard assets. I have attached a box collider to the empty object and made it a trigger. I attached a sound to the object aswell so when the “Graphics” collides with it, it will play a sound.
This doesnt work…
Is there another way to make sound play on collision? i have been researching this for a long time and couldn’t find the answer i was looking for.
Thanks for your time.