I'm making a platformer game with no prior experience.
I have a kinematic body for my main character and area2D bodies for my enemies.
So far, I've been able to make my character restart at the beginning of the level after she hits various enemies using this method:
Area 2D body is connected with body_enter
character script has this script:
onready var initialpos = getpos()
and the main node has this script:
func onEnemybodyenter( body ):
if body.getname() == "Player":
so it all works fine but I'd now like now is: after a certain point in the game, when the Player dies she only returns to the halfway point.
How can I achieve this?