I want my sound clip to play wen collision, but sound plays at the time the prefab the script is attached to is instantiated.
Any ideas out there?? …please??
Here´s my code.
public class Collision : MonoBehaviour {
public AudioClip crash;
void OnTriggerEnter2D (Collider2D other){
if (other.tag == "Player") {
other.GetComponent<AddForce>().controll = true;
AudioSource.PlayClipAtPoint(crash, transform.position);
Destroy (other.gameObject, 3f);
Application.LoadLevel ("Scene1");
ScoreBoard.scoreP2 = 0;
}
}
}