0 votes

Hi, I need help with getting my game to restart when the character is killed. Also for it to restart at the original location and for the enemy character to still be dead if they were before. Any code and advice would be helpful. The game is a 2d maze rpg.

in Engine by (39 points)

1 Answer

0 votes

You can reload the current scene with get_tree().reload_current_scene().

To keep your enemy state, you need to store it outside of the scene you reload. You could store it in an autoload singleton for example. You can find more info about Godot singletons in the official docs.

by (148 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.