- Home /
Question by
kyomazunki · Jan 31, 2019 at 07:30 PM ·
collisiondestroycollision detectiontagdestroy object
Destory() on Collision if Tag = Lazer [SOLVED]
This is a small part of a script for my enemy. If the enemy collides with an object & the objects tag is "Lazer" then delete the enemy. When the enemy collides with the lazer, it doesn't kill it. Anyone know why? (PS. All Objects Have 2D Colliders!)
Comment
Best Answer
Answer by deneme09 · Jan 31, 2019 at 07:38 PM
Do your objects have rigidbodies? Your code seems good. Probably the enemy hasnt a rigidbody. So, collision cant be calculated. Try to add a rigidbody2d component... It should fix