Answer the question
In order to leave comments, you need to log in
How to compare coordinates?
It is necessary to compare the "y" coordinates of the characters, and if they are equal, then one method works, if one of the characters has a larger coordinate, then another method works. But the problem is that the surface on which they stand is the same, and the "y" coordinates are different, because of this, the second method always works. Screenshots below:
Answer the question
In order to leave comments, you need to log in
As a simple solution, you can move the pivot down of the player and enemy sprites in the Sprite Editor so that the player's position on the axis doesn't differ that much when compared.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question