Hello! after a couple of hours trying to make an timer that works with the game paused i was wondering how efficient is. It would make my game slow or cause any problems in long term?
*Almost forgot it, on the “Begin play” event i get a reference of the timeline called “Timer” and set it the length and “SetTickeableWhenPaused” to true.
It really depends what you’re doing on tick, but tick is usually best avoided unless it’s something you actually need to happen every frame.
If you want something to tick when paused, why not just use a SetTimerByEvent. The whole blueprint can tick when paused ( it’s in the overall details ). Then you can set the timer to a reasonable amount rather than having it every tick.
As i said, im trying to make an algorithm that works while the game is paused, unfortunately SetTimerByEvent stops when the game is paused, as far as i know.
I haven’t specifically tried it, but I’m assuming when you set an entire BP to tick when the game is paused, the encompasses everything inside that BP.
Now I have specifically tried it. Setting the BP to tick when paused doesn’t work. But if you put this stuff in the controller or a widget, then it will.
Oh my concern is just because I’m a bit obsessed with efficiency, I don’t want the game to go smooth but in a menu there is a drop in fps. It would be a bit embarrassing.
And it dosent works with SetTimerByEvent, but thanks for your help!
From my experience efficiency is getting something working first - that’s you being efficient. Refactor later - that’s making your code (a wee bit more) efficient. There’s no need to optimise something that is not there.
I don’t want the game to go smooth but
in a menu there is a drop in fps. It
would be a bit embarrassing.
I’m not sure I follow. Are you saying that this one function has a bigger performance hit than the actual game? Why - are you doing some heavy async lifting while paused?