B
B
BadCats2017-08-24 22:53:04
C++ / C#
BadCats, 2017-08-24 22:53:04

Unity3d not working OnCollisionEnter2D?

void OnCollisionEnter2D(Collision2D collision)
{
if(collision.gameObject.name=="Fire")
    {
        Destroy(collision.gameObject);
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2017-08-24
@BadCats

Everything is working. You have problems. Either there are no colliders, or they are triggers, or they are not 2d, or something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question