Hi,
I was wondering how to set up “hit impact sounds” in Unity 3D.
Could someone please help me out here,by giving me a simple demonstration and/or example ?
For example try this attached to your gameobject you want to detect the collisions:
var crashsound : AudioClip;
Function OnCollisionEnter(other:Collision){
if (other.gameObject.CompareTag(“Scenery”))
if (audio.clip!=crashsound)
{
audio.clip=crashsound;
audio.PlayOneShot(crashsound);
}
}
Thanks.
I will give it a try.