Blueprint Timers & lack of secure functions calls (ie. only referenced by string name)

Nawrot
Wed, 14 Jan 2015 11:04:16 +0000
Blueprint

I find timers lacking, in part where you maintain them after creating. I can create timer by reference to existing event, but then cleaning, restarting etc. all is done only by filling up name of function in string property. This is very unsecure (and when forgotten gets quite unstable).

I changed name of my timed function, then somehow i overlooked one of functions that destroyed timer (maybe something else also). That led to crashes (few, but still i had no crashes without timers at all).

Second issue is that after level restart, i need to manually go trough all timers and stop/destroy them. For this i should store some information about them in array at creation time. It all gets complicated with more than very few timers. I also had strange case when game crashed on android device, but timer survived, so when i started game my event fired twice every second. I could not replicate this again.

Because of all of this i decided to use event tick, with interpto as a counter. It is a bit harder to set all delays (and do not use multiple counters), but its doable. Resulting bp graph is much smaller. Everything is in one event tick graph. I will probably try to get it all back on timers when my code matures more.

1 post - 1 participant