Answer the question
In order to leave comments, you need to log in
How to properly check for collision in Unity?
I'm trying to make a collision of two 2D objects in Unity. I do not use Rigidbody, but I calculate everything myself using BoxCast (on some CircleCast objects). The problem is this: when two moving objects collide, both say that they collided. And it turns out that the first object handles the collision and reduces health, and the second object handles the collision and takes health away from the first object.
How can it be more intelligently implemented so that collision processing is performed by one of the collided objects, and not both?
Answer the question
In order to leave comments, you need to log in
It is necessary to logically accept and then observe one of two conditions:
a) Objects with health take care of their own health. And no other entity but them has the right to do so.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question