Question by
unity_dtU7ncIXBupd9w · Dec 03, 2020 at 10:08 PM ·
if statement
How do I make those if statements work
Hello guys im a beginner and i've got a problem. I have these 3 if statements to check if these gameobjects are enabled on the scene, but after the 1st if statement the others don't seem to work. How do I make it work? What's the corrent way? Thank you.
private void OnTriggerEnter(Collider other) { Destroy(gameObject); Destroy(other.gameObject); Score.playerScore += 1;
if (leo.activeSelf)
{
LeoSound();
}
if (benny.activeSelf)
{
BennySound();
}
if (faria.activeSelf)
{
FariaSound();
}
Comment