- Edited
Hello, I'm trying to make a checkpoint for my game, but I don't want the sound for it to play every time you collide with it. This is what I have so far:
# Player Script
func _on_Checkpoint_body_shape_entered(_body_id, body, _body_shape, area_shape):
var collision_pos = shape_owner_get_owner(shape_find_owner(area_shape)).global_transform.get_origin()
checkpoint = collision_pos
$Sound/Checkpoint.play()
EDIT:
I have multiple checkpoints in different scenes (the checkpoint is also a scene instance), and I have them all send the event to the same method.