Open laurenmedved opened 8 months ago
The logic to check whether to exit the old shape is placed before the logic to check to enter the new shape.
Check whether to exit the old shape.
Check whether to enter the new shape.
Exiting the last shape causes the body to exit.
Tested versions
v4.1.stable.official [970459615]
System information
Godot v4.1.stable - macOS 13.5.2 - Vulkan (Forward+) - integrated Intel(R) Iris(TM) Plus Graphics 655 - Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz (8 Threads)
Issue description
Player is detected as leaving the area when they are still within the same CollisonPolygon2D. The exited signal for this only triggers when the player 'undos' within the top portion of this puzzle, which happens to be the only area where the polygon shape segments are pure rectangles. The player can undo in other sections of the puzzle without the exited signal triggering.
The exited signal should only trigger if the player is stepping outside of the entire collision area.
Steps to reproduce
Walk the player around using WASD or arrow keys. You have a move count and will need to recharge by stepping on the lightning bolt tiles. At anytime, you can undo by pressing "Q". In the first part of the puzzle, everything should work as intended, however once you get to the last stretch (as shown in this screenshot & video) undoing your player will cause the puzzle to deactivate because the body_exited signal is triggered. This only happens if the player is undone between the colored segments in this section.
https://github.com/godotengine/godot/assets/60891368/211625a3-9cf4-46d7-9633-8b0980833cdc
Currently I am able to work around this by setting up a function to check when the player is being 'undone' and then checking when that is false within the body_exited signal before executing any other code. This should be fine for my project but it still doesn't solve the fact that the exited signal is being triggered here in general.
Minimal reproduction project (MRP)
ISSUE_12302023.zip