I do have a object to which a script and a sound is beeing attached.
Now if i clone this object, throw it against another one the script says that it should play the sound and destroy the object on the OnCollisionEnter event but i can’t hear anything…sound is hearable at Awake if i would tag it, min volume is set to 1…
So a playing sound is also destroyed when the object is beeing destroyed… :O/
Do i need to instantiate another object and wait till the sound is played through just for that or is there a better way to do this?
Can’t we just please have an OnDestroy Function, where i could throw stuff like this in?!
The first two destroys make the object invisible and no longer affecting other objects–it’s intantly “destroyed” but the GameObject lives on so the sound can continue.
Then the GameObject is also destroyed, but with a delay of 2 seconds (adjust to taste–long enough for your sound). The time delay can also allow children (like debris) or particle emitters to do their thing if you need, and still all be part of one prefab with one script.