unity play sound effect

Code Example - unity play sound effect

                
                        public AudioSource audioData;

void Start()
{
	audioData.Play();
}
                    
                
 

play sound unity

                        
                                AudioSource audioData;

    void Start()
    {
        audioData = GetComponent<AudioSource>();
        audioData.Play(0);
        Debug.Log("started");
    }
                            
                        
 

Related code examples