hi Im building a 2d shooter and want to add a sound to a script that kills enemies but cant get it working.
This is the script
var hitPoints = 10;
function can_die (damage) {
hitPoints -= damage; if( hitPoints
< 1 ) { Destroy(gameObject, 0.0);
} }
Ive tried adding
audio.PlayOneShot(Sound);
with an audio source but cant egt it working.
Any Ideas?
Thanks