I have set up a simple damage script in my player blueprint. Telling damage to deduct from the player HEALTH variable, which is tied to the health bar. If health reaches 0, destroy actor
However, I am trying to create something like a spike block, that is moving, and causes damage to the player as it hits them. For some reason, I can only get damage to occur using a PainVolume or Overlap Event if I am moving or I am the one to move into it. It will not trigger damage if it hits me or overlaps me.
That is strange–not exactly sure why that would happen.
As a side note–you should subtract health before checking if your character is <= 0 HP. Your code right now checks health, then does damage, so right now your character can be reduced below 0 HP and still live–it would take another damage trigger afterward to destroy it.
That was gonna be my next question. I messed something up in the blueprint last night that caused that to happen and that is what it was. Thanks.
Still can’t figure out why a moving painvolume doesnt cause damage to me though