Timers do not work in Objects

Hi!

This bug is actually from 4.17, but still not fixed in 4.18.

Timers do not work inside Objects in blueprints.

To reproduce

  • Create an object class
  • Create event “Init” and connect it with “Set Timer By Function Name”. Make a function with a same name that should be called
  • Construct somewhere an instance of the Object and call “Init” event.

You will see event and timer fires as expected but function, that should be called after timer ends, never called.

This bug also appears in 4.16, but only on the same tick with Construct Object. In order to make timer work in 416, you should construct an Object and after delay call “Init” event.

In 4.17 or 4.18 this method does not make any difference, timers still not work.

Hi

Do you have any screenshots that you could provide to give additional information?

Thanks,

Sorry for a delay.
Here it is:

http://s1.uploadpics.ru/images/bkebOAP3nM.png

Any news on this? Really critical thing…

Hello

Apologies for the delay. Thank you for reporting this issue. I have created a JIRA which you can track here: UE-51011

Thanks,

Interesting, my guess is that Timers aren’t working because UObjects don’t tick.

To get around this, you could create a custom C++ class that implements FTickableGameObject, then base your BP class on that.

Yes, that may be the reason. But timers work well in 4.16.
And I think, that it does not matter, as timers work from Worlds time manager, not objects them selfs.

I’m getting this again in 5.4. Using a custom UObject base class, and added “Blueprintable” to the class flags, and in the BP child classes, I can make a timer using, “SetTimerbyEvent” or “SetTimerForNextTickbyEvent” or the function variants. The bound functions are never called.

Steps:

  • Make C++ class inheriting from “UObject”.
  • To the UCLASS flags add the “Blueprintable” flag.
  • Create a new Blueprint child of the new C++ class.
  • Create an event called “CallTimer” in the event graph.
  • In the “CallTimer” event, call “SetTimerbyEvent”.
  • Link a new custom event to the event pin.
  • Run the “CallTimer” event on any instance of the Blueprint class. (could use the level BP to ease)
  • Observe how the new custom event is not called.

Did I do something incorrect? It seems like this is the exact same issue as this thread. And looking at the report further, it appears at the time when this happened, this issue was considered a “Regression”. So I’m thinking it may have regressed again.

i believe its because you need a world context. override the GetWorld() Function

i can confirm it works for me