Find Audio Clips and attach an Audio Source Component to the following GameObjects: PickUp, Hazard, Water
Attach Audio Source to PickUp Prefab GameObject that has Trigger Colliders.
//In PlayerController.cs OnTriggerEnter2D()case "Colletible":PickUp item =collision.GetComponent<PickUp>();if (item !=null) {GameData.instanceRef.Add(item.Value); //points for each specific item's value //add to inventoryGameData.instanceRef.AddItem(item.itemInstance); //points for each specific item's value } //Find the AudioSource Component on collided objectAudioSource collectSound =collision.gameObject.GetComponent<AudioSource>();if (collectSound !=null) //make sure has Audio Source {AudioClip clip =collectSound.clip; //plays a clip at a point in worldspace, destroyed when doneAudioSource.PlayClipAtPoint(clip,newVector3(5,1,2)); }Destroy(collision.gameObject);break;