How to instantly call SetTimerByEvent to start

Hey guys,

How do i tell the SetTimerByEvent to stop its current cycle and fire immediately (lets say only 50% of its looping time has past, but in this frame i want it to fire) ?

is that even possible in blueprints?

Hey @Userofunreal!

So what you would do is simply call the event that is attached to the SetTimerByEvent, essentially bypassing the timer completely. Then use ClearAndInvalidateTimerByHandle to stop the timer.

Just right click out in the open and type the name of the actual event to call it.

Those two things should be all you need! :slight_smile:

Let us know if there’s more to it!

1 Like

Thank you for explaining sir

But that will stop the event completely, i want it to continue its regular looping paste overall beside when i call it instantly

You should be able to just call the event and not clear and invalidate the timer.

2 Likes

Thank you sir. it will be a bit of a hustle because i will have to create another event on around 10 calls a sec to be able to lunch an attack outside the the original event. (there is no player input such as this button simulate in your example)

I dont know why there is not a simple node that just call for a reset instantly. very strange design of the event by epic in my humble opinion. But ill do my best here and report back

There is definitely a way to go about doing what it is you want because there is no possible exception for timing of events here. I’m not sure exactly what it is that you are going for if it is not any of these cases.

That’s okay, an Event is an Event. You make a custom one to have it called from elsewhere, the button was just for testing, you can replace this with any event of your choice.

You have to stop and restart the timer if this is what you want. This is because a reset is just an off/on switch flip, so it is separated for multiple use cases. Something like this would run your code, and restart the timer. Just replace the “0” input with your event call.

1 Like

Thank you but i already solved this by separate it into a different event that controls that event’s timer by invalidate it and relaunch it when needed

Now im stuck on another issue which is line trace is outputting a wrong distance to hit actor because of collision boxes that are set to ignore its channel but for some reason still mess its calculation .

Great! Do you have a new thread for that problem? You should make one if not! :slight_smile:

1 Like

Thank you !

I have solved it by creating the same blueprints this in a new project and then migrate it into the main project. i still dont know what was the issue, as the migrated one was exactly the same. But at least it is working