lets say I have a door tagged, "door." what is the code to play a sound when controller hits the tag?
Ok you need to make a new script and add the following code:
var DoorSound : AudioClip;
function OnControllerColliderHit (hit : ControllerColliderHit)
{
if(hit.gameObject.tag == "door") {
AudioSource.PlayClipAtPoint(DoorSound,transform.position);
}
that should do it :)