Could somebody please give me so clearance/basics on how to create a simple timer and how to stop said timer etc, or
describe to me how it works? Thanks.
That’s outdated, unfortunately. In 4.7 timers changed a lil bit.
Now you must declare an FTimerHandle object. Name it whatever you want.
FTimerHandle Whatever;
Then get the game world, get the world’s timer manager, then call SetTimer(). SetTimer() has a number of overloads, but the simplest one in my opinion takes the FTimerHandle you just declared, the object that will contain the timer (in this case, the calling object), a reference to the method you want to call (as a delegate), the number of seconds to wait between each call, (optionally) whether or not it should call the method over and over again (defaults to false) and (optionally) how many seconds the Timer should wait before starting.
So here I want to send a message to this object that says “Call TheMethodIWannaCall() every 5 seconds and do it over and over again every five seconds after that.” I left out the last parameter because I don’t want the Timer to wait any longer before waiting the first five seconds. You can leave out the second-to-last parameter if you don’t want to loop.
I had timers working on 4.6 on a SCompoundWidget extending the Editor to poll an array of objects for updates (filled by another Thread). I suppose this isn’t working anymore? Any workarounds for 4.7 on this?
My timer function is never called since the update ;-(