using System.Collections; using System.Collections.Generic; using UnityEngine; public class TriggerSound : MonoBehaviour { private AudioSource hitSound; void Start () { hitSound = GetComponent(); } void OnTriggerEnter(Collider other) { hitSound.Play(); } }