The damage (or death event) doesn´t seem to work

Does anybody have an idea what the problem is?
I tried casting to the hit actor as shown in the video as well (even though that is not useful but I just wanted to make sure it wasn´t the problem).

I added some screenshots. For context: Player 1 (the demon character) is the actor that I am trying to damage (for now).




I would be grateful for any help.

I would double-check to make sure the correct actor is being hit, and that the value of the variable “Damage” is not 0.

Hey, first of all thanks for your response.
By “the correct actor is being hit” are you referring to me aiming correctly and/or making sure that the actor that I put into my level is the actor that I programmed to take damage and die? Or something else?
On the first 2 pictures you can see that the actor in the level is the one that is programmed to take damage and die. On the last picture you can see my Damage value. It´s 1000. And the Player1 actors health is 1500.

Bug5


So if you place a breakpoint on the Apply Damage node (select the node and press F9), you can mouse-over the Hit Actor pin in the Break Hit Result node when you run your game and attack a target (ideally the breakpoint will be hit, pausing the game so you can do this).

You’ll be able to see the value of Hit Actor, confirming which actor is actually being hit (if at all).

Hey, so I did what you said and I hovered over the hit actor and clicked on it and it definitely is the right actor.


So you want Player1 to hit… Player1?

No :,D.
Player1 is the actor that´s being hit and Player2 is the actor causing the damage. On the screenshots you can see that the “Apply Damage” node is in Player2 and and the “OnTakeDamage” node is in Player1. Player2 is the character with the sword and Player1 is the demon that´s being hit.
I am aware that the naming might´ve been a little unideal.

Sorry for the confusion, the second screenshot implied that the break result from coming from Player1. Does the game pause if you place a breakpoint on the SetHP node for OnTakeAnyDamage?

Yes

Ok, so far we’ve confirmed that the damage event(s) are being triggered, which is good. And based on what you’ve shown me the code for decreasing health looks correct. So then the question becomes “If the intended target is being hit, why is the HP not going down?”

I fear there may be a more subtle reason but I’m not able to wrap my head around. If you don’t mind, you use this form to upload your project and I can have a more direct look.

You have probably figured out the problem, but if not here is what I would start off doing: I would place a print string function after “on take damage” function/ event; if it does not print then the damage is probably not being sent. If that is the case, I would go to the Apply Damage function and use another print string function following it and make sure the return value Displays the damage value when I shoot at the correct target (in my case it is 10.) (I would keep using print string until I narrowed down the problem.)

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms