Why my For Loop with Break not working?

I’m making an effect of bleeding for my game and for some reason this loop isn’t working. Can any one tell me what is going on?

A loop like this will execute in a single frame. You’re applying 20 bleeds instantaneously. Also, there’s nothing to break the loop. You let it run once and set a variable. Next time bleed is called, the loop will terminate immediately.

How would you like it to work?


This will start a bleeding timer that executes 5x per second, deducting 4 health from the player’s health pool each time, for as long as the LMB is held or until the Bleed Count is reached:

The above would run 15 times over 3s and leave the player with 40 health.

1 Like

Ok it works but health amount isn’t changing and i don’t know why

How are you checking whether the health is changing?

Make sure you punch in a default value into Bleed Amount. Otherwise we’re deducting zero.

Nothing changing health still on 1.0
Its like seting health is not working


Even that isn’t working

Does it print anything? When you connect Input Action to Print directly, does it print? Which blueprint is this in?

Yes it prints my amount of health with is 1.0 and it is in base character bp
(I’m using ALS v4)

If you’re unable to do a basic subtraction, then you have a more serious issue at hand.

Perhaps figure out first why this basic var is not updating. Only then move to actual mechanics.

Perhaps something else is setting it on tick?


No clue what ALS is.

ALS is Advanced Locomotion System (Epic games asset store)

Pressing a button and doing A-B should work no matter what. Does it?

Here is my implementation of the DOT
In the projectile, I call the custom event
UEdpt3
In the pawn, I do this


Custom forLoopDelayed macros

Thx