Download

How to call "Tick" much faster than per frame?

I need to make a loop that checks GPIO input. Currently I do so by using the normal tick function, however this only polls the input at 60hz (or whatever the gpu is rendering at) and this causes some missed presses if the player is pressing the button rapidly. How can I make my own “tick” function to just watch for this custom input at a faster rate?

You can’t, Tick runs as fast as the rest of the Gamecode and is just that - a single ‘Tick’ of the game engine.

IMO the solution in your case would be to create an input poller of some kind that runs on a separate thread, and accumulate input so that the game thread can use it. You’ll have to do some work to make that thread-safe of course, and then every game tick you reset the accumulated input and start again.