Answers for "play sound on collision unity c#"

C#
2

play sound on collision unity c#

void Start ()
 {
     saw = GameObject.FindObjectOfType<AudioSource>();
 }
 
 void Update ()
 {
 }
 void OnCollisionEnter(Collision col)
 {
     if(col.gameObject)
     {
         saw.Play();
         Debug.Log("Nurrrr");
     }
 }
Posted by: Guest on July-04-2020

C# Answers by Framework

Browse Popular Code Answers by Language