Godot Version
4.4
Question
The player is a rigid body 2d. When they hit the killzone area, they are supposed to be teleported back to their last checkpoint, but for some reason it puts the player back where they were when they entered the killzone, then teleporting back to the checkpoint, then back to the killzone, etc.
In the video it looks like it only happens once, but it happened like every frame.
Heres the code for the killzone
func _on_ball_collision_area_entered(area: Area2D) -> void:
if area.name == "zonekill":
position = GameManager.spawn_point #this is the position of the players last checkpoint.