UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"change audio on walking and running"
public class AudioChanger : MonoBehaviour { [SerializeField] AudioSource walkSound; [SerializeField] AudioSource runSound; [SerializeField] AudioSource exhaleFX; Rigidbody body; float timePastSinceRun; void Start() { timePastSinceRun = 0; body = GetComponent<Rigidbody>(); } void Update() { if (body.velocity.magnitude > 2