Im having a weird issue with Audio. I have a trigger set up that plays a metal clank when you step on it. You walk over it and it goes clank once and springs the trap. This always works the first time. When you die you get set back to a check point and the trap gets reset. The second time I Trigger the trap the audio will not play, In fact no matter what I do I cant get the audio to play. even using a bool and update and turning it on in inspector it simply will not play.
var triggered : Boolean = false;
function OnCollisionEnter2D(col : Collision2D)
{
if (col.gameObject.tag == "Player")
{
if(triggered == false)
{
audio.play();
triggered = true;
}
}
}
Then in another object we have a script that detects collision with player and kills him that sets triggered back to false (which is working perfectly) When I trigger it again and set the trap loose it will not play the audio. Even if I trigger bool over and over.
I have even tried loading the clip into AudioClip and PlayOneShot(name); still doesn’t play a second time.
The scene does not reload you are simply Instatiated to a playerSpawner object