Player death and scene restart

Godot Version

4.2.1

Question

Hey, everybody! I want to make a character death, when he touches an item, the scene restarts. On reddit they told me to use area2d and groups (body.is_in_group(“X”):, but I can’t construct the code properly, please help me. :confused:

Hey there!

You can find the “Code” to do a character death and restart here:

But really, if you are asking this question, code alone won’t help you in understanding.

Take a look at this tutorial here → Your first 2D game — Godot Engine (stable) documentation in English

After you do the tutorial above, things will make much more sense.

I recommend taking a look either on Youtube or in the Tutorials category of this forum and doing things step-by-step with the tutorials, while trying to understand everything that is going on.

If you encounter issues, try to look up the error on Google, otherwise if you still can’t solve the problem, you may have more luck here, but you really need to understand the code you are writing otherwise other users won’t be able to help you either.

Good luck!

1 Like