What order are events fired in?

If I am using input events, tick events, events like OnLanded, etc. What order do these fire in? I would like the tick event to fire last each frame, and I need to know if it is or not. Thank you.

Order!? There is no order. Each event is fired, when the action/event occurs and tick events are fired every frame.

Sure there is a order. In blueprint events are, other than functions, not certainly executed in the moment they are called, the engine could even wait a few tick until it executes them if I remember the documentation correctly. So I think it’s a great question which I already often asked myself…
If I call an event from a function, what happens? Does the function first get’s executed completely and then the event fires, or is an event like a function and does the event first run and after this the function continues to run? I guess with an event the function first completely runs and then the event is executed.

1 Like

I think both the comments above have their merits. I agree with that there surely is some sort of order in which events get fired; however, tick is firing at around 60 times per second (depending on current frame rate) and therefore would be extremely difficult to ensure that the order you need your events to fire would be accurate. For example, your custom event could be called mid tick meaning that the tick would complete then run your event. Everything happens so fast, success would be very hit or miss. Let alone the fact that computers can process more than one piece of information at once so your custom event could easily run simultaneously with the tick.

What I would suggest, if you need your tick to fire only after completion of your custom event/function is this: if you normally need tick running in the blueprint then let it run as normal but if you absolutely need to ensure that it halts operation while you run your other event, then just use the node “Set Actor Tick Enabled” as the first node in your custom event and ensure the boolean is false. Write the rest of the logic for your event and as the last node in your event run “Set Actor Tick Enabled” again only this time set it’s boolean value to true. This will ensure that tick does not run (and therefore complete it’s cycle) until after your custom event has finished execution.

Hope this helps! If it did, please do me a favor and click the check mark located under the arrows next to the answer to accept it. If successful, the answer will highlight green. Thanks and good luck to you!

Hi , of course deep in the engine implementation there is some order and rules for the execution of functions, Event calls, Timers, Timelines, Delays. But the original question is talking about input events and character events that occur due to user interaction or certain navigation condition of the character. So there is no order for that, they just fire when they occur, after tick or before tick is almost irrelevant. And my advise is that when you are blueprinting don’t trust completely in the “order” you think things are done.

Blueprints are serialized, i.e. they are single threaded, I was asking this question in reference to a blue print having a lock node, same thing.

I have not looked into the engine, but more than likely, or my guess if you will, is that each “blueprint” (and I use that term loosely), has a queue of “events” that needs to be processed, and that “Tick” can override any of that processing, when it’s ready to fire, because of “Tick” being so fundamental, I’m willing to bet that it has precedence. But as “events” come in, they get queued, then dispatched as the internal “scheduler” of the engine determines they should be. I say this, because I have never read any official doc, that mentions an order to “events”, yet there is specific verbage, about Tick events, that if they are not firing as fast as the engine determines they should, then they will get a higher “precedence” on the next tick cycle.

Just some thoughts.