How to stop set timer by event

Hey all

I’ve made a flamethrower ability, where the particles at the end have a sphere collision which of course, if it touches anything, will bring the health down. This is my setup:

Because it’s a flamethrower I want to do damage per sec, not in one go obviously. The issue is when I take it off looped, it of course just does one hit, but if I do it on loop, even after the animation/actor is gone, it still damages nonstop till death. How do I fix this, so it only damages while the actor is actually there?

Thanks!

1 Like

One way of doing this is to have the area-of-effect have an overlapping sphere.
In Actor Begin Overlap, add the pawn to a list of pawns to damage.
In Actor End Overlap, remove the pawn from the list of pawns to damage.
In Tick, or on some timer, apply damage to any pawn in the list.
When the list is empty, nothing gets damaged.
If you have many of these, then each sphere can be small.
Efficiency is alright, as long as you keep it to “dozens” rather than “thousands.”
If you really do need “thousands,” look into how you might be able to set it up with Niagara or GPU compute or something like that.

2 Likes

You can also get a reference here

image

and later

image

3 Likes

Do you have a Clear and Invalidate Timer by Handle node in there? You need to make it so that it fires off when releasing the trigger. This will stop your flamethrower.

image

3 Likes

Thank you!

Thanks!