How to reset player character's sprite upon restarting game?

Godot Version

Godot v4.7.1

Question

I am making an infinite runner game, and I’m almost done with making it. The last problem I’ve run into is with the player sprite.

I have it set up where when the player collides with an object, the Atlas Texture region changes to display a ‘dead’ sprite, instead of an ‘alive’ sprite. I have a CanvasLayer with a button on it that reloads the current scene when pressed. Everything reloads fine, except for the player sprite. It remains as the ‘dead’ sprite, and doesn’t revert back to the ‘alive’ sprite.

I’ve read around that I could use the Autoload singleton method to have a Global variable, so that my ‘restart’ button can call upon my ‘player’ scene, but I’m having trouble understanding it.

Any help would be appreciated!

Reset the region in player’s _ready()

In your logic that sets the dead animation, does it use if dead = animated_sprite.play(“dead”)?

If so, in your restart logic, try just setting dead = false