I have a 2D game where A attacks B and then B attacks A (turn-based). A attacking B works fine, but B attacking A has issues - read the issue part for explanation.
GameObject A walks towards
B. It collided with B normally and performs action
OnTriggerEnter. Now the same thing should occur with
GameObject B walks towards
GameObject A. It DOES NOT collide where the actual boundaries of BOX COLLIDER are (both use two
Box Colliders, one for actual collision, other one for
IsTrigger events). But it stops in the middle of
A, crashing to it for few times and stops.
BoxCollider boundaries are set OK. Even if I make them bigger, the first scenario (A → B) works as expected (will stop even sooner, because of bigger collider on B), but vice versa (B → A) won’t work and same scenario happens (B will walk to center of A and keep hitting to that point few times and stop).
I don’t know what I am doing wrong. I think I might be missing something related to 2D Physics of using BoxColliders.