using UnityEngine; public class Music2D : MonoBehaviour { public AudioSource music; void OnTriggerEnter2D(Collider2D other) { music.Play(); } }