Godot Version
4.3
Question
Hello everyone! I have a problem with Area2D, and I really can’t figure out how to solve it. Please help me
Run the program
A CharacterBody2D moves on two parallel Area2Ds A and B. When it leaves A and enters B, B’s “body_entered” will be triggered first, and then A’s “body_exited” will be triggered.
My original intention is to enlarge the cursor when the cursor enters the area, and play the cursor’s zoom animation when the cursor leaves the chess piece. But because of this triggering order, this function cannot be achieved when the cursor moves between two side-by-side chess pieces.
This triggering order seems to be related to the direction of cursor movement. When the cursor moves from A to B, and then from B to A, B’s exited is triggered first, and A’s entered is triggered.
It’s very strange, I don’t quite understand the principle.
Is there any good solution?