L
L
LittleBob2022-01-21 21:27:41
Unity
LittleBob, 2022-01-21 21:27:41

How to call the OnCollisionEnter2D method "permanently"?

I can't figure out how to solve the following problem: The
enemy touches the character and takes away his health using the OnCollisionEnter2D method. But the enemy continues to go to our character, that is, he is constantly in contact with him. But at the same time, the method is called only 1 time upon contact. It turns out that if you do not move, then after one hit by the enemy, the character gains immortality. How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Ukrainskiy, 2022-01-21
@LittleBob

OnCollisionStay2d

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question