OnTriggerEnter audio problem
Hi guys,
I seem to have a problem - when my player hits a box collider that is set to trigger nothing happens
Heres the code:
#pragma strict
public var AudioTape : AudioClip;
private var guiShow : boolean = false;
var text : UnityEngine.UI.Text;
function OnTriggerEnter (Col : Collider)
{
if(Col.tag == "Player")
{
audio.PlayOneShot(AudioTape);
}
}
Here a link to the image of the collider http://answers.unity3d.com/storage/temp/58360-fffff.png
Thanks for your help.
"Nothing happens" could mean many things. You may want to print some debug messages to narrow down what's failing. Is the collision happening at all? Is the collision happening, but the check is failing? Is the check passing, but the audio call fails?
The console is a powerful feature. The debugger even more so.
I found nothing in either, perhaps its a sound issue.
Your answer
Follow this Question
Related Questions
Stop AudioSource on Trigger!!! 1 Answer
Can't figure out how to play a random audio clip when player collides with enemy 1 Answer
Trigger an animation (state) within the animator controller using audio input from VR microphone 0 Answers
How do you trigger an audio clip when two game objects collide with each other? 0 Answers
Trigger detects player collision and play specific audio from array 1 Answer