Question by
niamut · Dec 29, 2015 at 04:11 PM ·
audio2d gametagoncollisionentercollision2d
How to set a tag to a collision?
hi guys,
How to set a tag to a collision and make it work?
void OnCollisionEnter2D(Collision2D collision) {
dead = true;
PlaySound(0);
if (collision.collider.tag =="Sound")
{
PlaySound(1);
}
}
if the collision has the tag sound the audio Playsound(1) should play. but that doesn't happen. What am i doing wrong?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612054239im_/https://answers.unity.com/themes/thub/images/avi.jpg)