Answers for "unity audio source playoneshot"

C#
-1

unity audio source playoneshot

public AudioClip impact;
    AudioSource audioSource;

    void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }

    void OnCollisionEnter()
    {
        audioSource.PlayOneShot(impact, 0.7F);
    }
Posted by: Guest on January-24-2021

C# Answers by Framework

Browse Popular Code Answers by Language