Y
Y
yraiv2020-11-25 16:14:45
Unity
yraiv, 2020-11-25 16:14:45

Why does OnCollisionEnter2D fire twice?

Sometimes thrice, sometimes 1 time, and sometimes 2 times the script is triggered

void OnCollisionEnter2D(Collision2D coll)
    {
        if (coll.gameObject.tag == "Throns") 

        {
            Health--; 

        }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question