Hey, I’m making a game, and whenever I touch a box collider or a circle collider etc. Here’s all my code’s where I I use the destroy thing.
void OnTriggerEnter2D (Collider2D hitInfo)
{
if (hitInfo.gameObject.tag.Equals ("Enemy"));
{
Destroy (hitInfo.gameObject);
Destroy (gameObject);
}
and
void TriggerEnter2D (Collider col)
{
if (col.gameObject.tag.Equals ("Player"))
{
Die.Play();
Destroy (col.gameObject);
}
if (col.gameObject.tag.Equals ("Bullet"));
{
PlayerDie.Play();
Destroy (gameObject);
and
void OnTriggerEnter2D (Collider2D hitInfo)
{
if (hitInfo.gameObject.tag.Equals ("Enemy"));
{
Destroy (gameObject);
I don’t know if the code’s help, but if anyone know’s how to fix please reply. Thank you, much appreciated.