Question by
aballif · May 18, 2016 at 12:02 AM ·
collisionaudiosourceontriggerenter
Play Sound on TriggerEnter
I have many audio sources in my game so I only want them to play when a collision is detected. I could put a GameOject.GetComponent<AudioSource> ().play ();
in my onTriggerEnter Function, but would that be bad for my game if some GameObjects don't have an audio source?
Comment
Your answer
Follow this Question
Related Questions
Make object(s) stack vertically. 0 Answers
OnTriggerEnter is not called 1 Answer
Cannot Play audio clip using OnTriggerEnter C# 0 Answers
Check if tag is the same as the previous one 1 Answer
Trigger not detected 0 Answers