The goal
There's these 2 scenes that represent voodoo dolls based on the 2 main characters (Player and Companion).
- VoodooDollPlayer
- VoodooDollCompanion
If they get hurt (Either touched by enemies or the Player's knife attack), they make their respective character get hurt.
This is part of a specific level where the main characters protect these dolls from enemies.
The problem
When the Player's health reaches zero after stabbing their dedicated doll, the live count goes beyond 1, which of course is game breaking.
What I personally find it weird is how no relevant script stuff related to this involves _physics_process().
In general, the way how the doll hurts the player involves a function used in an animation called "doll_hurt".
One reason being so the doll itself also has a "pain animation" where its hurtboxes are disabled.
Because the Player has their own pain animation, so they can’t lose health in a short time period after getting hurt.
Relevant video: https://imgur.com/a/hzUlZMV
The relevant scenes
- The relevant level is NortPartSevenLevel4
- The voodoo doll in question is VoodooDollPlayer
- The global "Signals" script has the signals: voodoo_hurts_player and voodoo_hurts_companion
- PlayerCopy has voodoo_hurts_player in the script and then a function called _player_hurt_by_voodoo() on their script https://github.com/EyeBallTank/PROJECT-NORTUBEL-main-ish/blob/main/src/play_actors/PlayerCopy.gd
Thank you for any help regardless.
FIXED: Just created dedicated health bars for the dolls and sort of redid the idea so it's not as "literal" but still.