Door Pose Fix for Custom Levels (#728)

Fixes an issue with the DoorPose animation and detection I added where if there was another End Castle behind you, you'd get sent back in the level. This is primarily an issue for Custom Levels, and is extremely noticeable when reloading resource packs. And in the video below, it also broke the Door Pose animation in the level.

This PR adds an extra check by using a collision shape to make sure the player is in the right area before applying the positional changes.
This commit is contained in:
KirbyKidJ 2025-11-22 08:34:57 -08:00 committed by GitHub
parent a681fed56d
commit 7457570014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 4 deletions

View file

@ -41,7 +41,7 @@ func _process(_delta: float) -> void:
func _physics_process(_delta: float) -> void:
for i: Player in get_tree().get_nodes_in_group("Players"):
if i.can_pose and i.global_position >= global_position and i.sprite.sprite_frames.has_animation("PoseDoor"):
if i.state_machine.get_state() == "LevelExit" and i.can_pose and $PlayerDetection.is_player_in_area() and i.global_position >= global_position and i.sprite.sprite_frames.has_animation("PoseDoor"):
i.is_posing = true; i.can_pose = false
i.global_position = global_position
i.play_animation("PoseDoor")