Download

Issues trying to assign health to a gameobject...

This mostly works, the nodes I used in this attached picture. These nodes are part of the Blueprint of the box that I am trying to destroy. I feel like there’s something minor I may be overlooking.

I’m trying to make a box I can fire my projectile (Bullet) into a few times and then destroy the actor after I “kill” it. The health variable is a public variable that I’ve set to 5 in the Details panel of the World Outliner instance of this box.

So, when I run this game the box starts off with 5 Health and every time I fire my Bullet at it, somehow it decrements the Health variable twice per shot. I’m “killing” the box in 3 shots instead of 5. Why?

Thanks in advance!

you could replace the health variable with a variable damage and on create event set it 0 and on collision event set it to +=1 and destroy the other actor, and do a step event or however unreal engine handles steps and check if the variable damage, for the enemy actor’s damage is greater than 4 it destroys itself, because the damage is clearly 5 or higher, you see what you have done by accident is a major flaw in development you have set it to check if it is eqaul to 0 health or in this example 5 damage, what you in your case should be doing is checking if its smaller than 1 or if unreal engine allows this parameter <=0 (also known as the less than 0 or eqaul to 0 parameter) or in the example i am showing you well i would use this parameter for the variable damage >=5 (also known as the greater than 5 or equal to 5 parameter).

If i helped you out here in anyway possible. Please kindly try to help me with my topics and my unreal engine problematics.

Thanks, this answered part of my question

It turned out to be that I had both the box collision and the static mesh of my Bullet Blueprint triggering an overlap event each. This caused the box I was trying to destroy to fire the health decrement function twice per shot.