using System.Collections; using System.Collections.Generic; using UnityEngine; using FMODUnity; public class OnCollideSound : MonoBehaviour { [SerializeField] EventReference soundRef; [SerializeField] float minCollisionForce = 1.0f; private void OnCollisionEnter(Collision collision) { if (collision.relativeVelocity.magnitude >= minCollisionForce) { RuntimeManager.PlayOneShot(soundRef, transform.position); } } }