Trying to make my character tired after dying

Question

So I’m a beginner and trying to make my characters have decreased speed and different animation after they die. However, my problem is that I don’t know how to connect my death script with my player script.
So basically, I have a “var tired = false” and when the player dies the “tired = true” but it didn’t work since tired is still false. I hope I explained this clearly.
player script:


dying script:

different nodes

If your dying script knows that body.is_in_group("Player"), then the player must be equivalent to body, so you can use the player’s variable via body.

body.tired = true

Make sure to paste scripts instead of code screenshots

1 Like