gimm270-audioenvironment/Assets/Scripts/ImpactTrigger.cs

24 lines
363 B
C#
Raw Permalink Normal View History

2022-10-31 00:08:36 -06:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ImpactTrigger : MonoBehaviour
{
AudioSource source;
void Start()
{
source = GetComponent<AudioSource>();
}
private void OnTriggerEnter(Collider collider)
{
source.Play();
//Debug.Log("audio.Play Called");
}
}