Hey, I tried something:
if(other.transform.tag == "Player")
{
GetComponent<AudioSource>().Play();
GameManager.currentScore = GameManager.currentScore + 250;
Destroy (gameObject);
}
… but the sound isn’t there…
Hey, I tried something:
if(other.transform.tag == "Player")
{
GetComponent<AudioSource>().Play();
GameManager.currentScore = GameManager.currentScore + 250;
Destroy (gameObject);
}
… but the sound isn’t there…
probably because you are destroying the gameobject before the sound plays?
Try putting collision code within the player script (and also the audiosource & clip)