checkpoint problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zombie

i did a checkpoint in my game and it works but when the player dies he spawns in the same x axe but not in the same y axe any solutions for that ?

checkpoint script :
extends Area2D

func _on_Spawn_body_entered(body: Node)-> void:
if body.name == “Player”:
Global.update_spawn(self.global_position)
Player script :
func _ready():
self.position = Global.spawn_point
global script :
extends Node

var spawn_point = Vector2(-800,510)
func update_spawn(new_point):
spawn_point=new_point

you may want to provide some code. Your issue could be a result of multiple things

godot_dev_ | 2023-06-19 17:22