Skip to content

Commit dbe675c

Browse files
committed
SpawnPoint: Add player_teleported signal
Level scenes can use this signal to behave differently depending on which SpawnPoint was used (or no SpawnPoint at all).
1 parent 54467b0 commit dbe675c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scenes/game_elements/props/spawn_point/components/spawn_point.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
class_name SpawnPoint
55
extends Marker2D
66

7+
## Emitted after the player position has been changed.
8+
## [br][br]
9+
## Level scenes can use this signal to behave differently depending on
10+
## which SpawnPoint was used (or if no SpawnPoint at all was used).
11+
signal player_teleported
12+
713
@export var look_at_side_on_spawn: Enums.LookAtSide = Enums.LookAtSide.UNSPECIFIED
814

915

@@ -24,3 +30,5 @@ func move_player_to_self_position(smooth_camera: bool = false) -> void:
2430

2531
if is_instance_valid(player):
2632
player.teleport_to(self.global_position, smooth_camera, look_at_side_on_spawn)
33+
34+
player_teleported.emit()

0 commit comments

Comments
 (0)