Tick event disable


Im curious how to do tick events but having a specific sequence disabled.
Right now im using branch to check if it can do the event. But the problem with this is that it is still checking every tick if it can do it.

One way i though of doing it, is to create a looping timeline and activating that, instead of setting the bool on a tick event.
Which would be more economical?

im using a looping timeline. it works fine

btw, i think in c++ you can deactivate event ticks

But if you are using a branch then surely the tick event is optomised already. From my understanding the tick event fires every tick whether you have something wired to it or not … with your boolean check you have already optomised it.

I stand under correction, but that is my understanding of the “Event Tick”.


Yeah i think its less resource intensive if you branch but im concerned about having it there. Because it checks the bool constantly.
Think i will rework some elements to use the looping timeline which can be activated or deactivated and works like a tick event.

Unfortunately i don’t use C++ yet. Perhaps in the near future.

I could be wrong but I think the timeline is being ticked internally anyway so it’s not really any different.

Besides, checking a boolean per tick is really fast.

Hmm. Would be nice if we can get official word on timelines ticking even if they are stopped.

Timelines are indeed ticked all the time (at least when they’re running they are), so looping a timeline instead won’t make any difference. If you want to, you can set TickEnabled to false. (It’s exposed to Blueprints now), then re-start the ticking when your event to change the bool happens. Honestly though, not checking a bool on tick isn’t going to give you any performance boost whatsoever!

Qdelpeche is also correct, the Tick Event technically still fires (in code) if you have Tick Enabled set to true anyway, regardless of whether you have anything attached to it! The only way to stop an actor ticking is to quite literally turn the ticking off.

There’s also an option to do this in BP. Click the actor and check the details pane to enable/disable ticks, and then also just look for a Enable Tick Events node in BP.

But if timelines are not ticking when stopped then this is what i want.

So you reckon doing a branch every tick against 140+ bools will not have a performance impact?
If that is the case then i wont spend the time redesigning some of the game logic.

And i dont really want to disable ticking for an entire actor because there are still other things that requires to be run on the tick event.

Why are you using so many bools to drive game logic … is this not a case for Game States now?

Its an accumulation of bool’s. For example you have 150 NPC’s standing and doing stuff. Then checking a bool to see if they should be doing something else instead.

Okay … but if they are NPCs, I am assuming they are some form of AI, than surely you should use the AI Behaviour Tree instead then.

Blueprint Behavior Tree Tutorial
Behavior Tree Quick Start Guide

You can also just tell me to shut up … just trying to understand what you want to achieve so that maybe we can assist you. 8-}

Hmm, never tried the behavior tree. Will investigate it thx.

No… questions are good. Also currently i do not have so many bools checked every tick. This is more of a for future reference thread, because i will be moving in this direction in the next few days.

Okay cool … I think with that many bools, you could end up with a performance hit. Hopefully behavior trees will do the trick for you. Good luck with your project. 8-}

But you know what is faster? never checking at all

If the object is meant to be checked until a certain point and you don’t destroy the actor then I would use a timer and then clear the timer once finished so that no further checks are performed.