Tick and input actions order of execution
I was wondering about the order of execution concerning ticking and inputactions. Specifically I have an input action that causes the recalculation of a motor vector. This motorvector is added to the movementvector and the movement is then applied, each tick.
Is it possible that the tick continues doing whatever it's doing without ever waiting for whatever the inputaction does to finish? I don't know much about threading but does tick have its own thread possibly?
Ticks are executed asychronically (if multithreading is on) in groups called tick groups, here you got list of them (saddly this enum dissapered from API refrence so link is to github):
If one group is finished the other one is executed. You can switch tick group of invidual actor with this function:
You can also define invidual actors which need to be ticked before tick is triggered in specific actor
This way you can control order of actor ticking.
As for input i'm not sure, it probably updated before ticking is started. There function that let you check if specific button is pressed at the moment:
Which let you order up input checking too
answered Sep 06 '15 at 04:23 AM
This is an old question - but the order of input delegate events vs actor ticking has been bugging me for a couple of days now and I think I found the answer by simply attaching the debugger to a compiled version of the engine (4.22 in this case), and checking the callstack when a bound input delegate is called:
APlayerController has a tickgroup of TG_PrePhysics: (more on tick groups) https://docs.unrealengine.com/en-us/Programming/UnrealArchitecture/Actors/Ticking
During the APlayerController tick, ProcessPlayerInput is called, which fires off all the bound delegates for registered InputComponents
So, bound input delegates are called during TG_PrePhysics - here's the callstack:
Follow this question
Once you sign in you will be able to subscribe for any updates here