Question by
tiaistianingsih · Aug 08, 2017 at 04:21 PM ·
unity 5javascriptcollisionaudiodestroy object
Destroy Object on Collision (with di sound)
I have a problem with the sound. The script I created is no error. But the player destroys the object not producing sound.. PLEASEEE HELP :((
screenshot-20170808-231228.png
(522.2 kB)
Comment
pragma strict
var coinSound : AudioClip ;
function OnTriggerEnter (other : Collider) {
if(other.tag == "Player") { Destroy(gameObject); GetComponent. .PlayOneShot (coinSound) ; } }
Your answer
Follow this Question
Related Questions
New Hierarchy Son Script 0 Answers
Player should be able to go through Wall 3 Answers
Let your children collide! Multi object collision problem 0 Answers
Error when trying to make script for main menu. 0 Answers
help with switching camera 0 Answers