Godot Version
3.5.1
Problem with “voodoo doll” mechanic.
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 should 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: Imgur: The magic of the Internet
The relevant scenes
In case I still can’t use more than 2 links:
-
The relevant level is NortPartSevenLevel4
-
The voodoo doll in question is VoodooDollPlayer PROJECT-NORTUBEL-main-ish/src/level prefabs/voodoo dolls/VoodooDollPlayer.gd at main · EyeBallTank/PROJECT-NORTUBEL-main-ish · GitHub
-
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
Thank you for any help regardless.