So i have several functions on tick (it’s crucial that they should be on tick), And when i reach certain condition i need to stop these functions. Right now i have a Branch that checks the bool, but can i do it any other way? I don’t want to have several branches to be ticking every frame for the entire game just because i needed them 1 time at the start of the game
If it’s an actor, you can SetActorTickEnabled(false), and if it’s a component you can use SetComponentTickEnabled(false)
Same functions exist in blueprints
Well i have other logic on tick too, i don’t want to disable everything that’s on tick, just several selected functions
if its temporary just use a timer instead of tick, the you can start and clear it whenever you need.
As said in my first sentence i need this logic to be executed on every frame
Ok Timelines seem to be the perfect solution
timers can also run on tick, just set it to your frame rate
How do i do that, as far as i know it gets 1 value and can not change depending on delta time
essentially tick is a speed of 1/60 so you could set your timer to that, of course frames could drop but then i cant imagine a timer can go faster than the frame rate anyway.
what are you using it for? i could be wrong but this is how i do it and works for me.
One of the features is DropPod (like spaceship Escape Pod) falling animation and it gets very jittery if it’s not synced with framerate. And it is PC game so my framerate is variable and not locked to 30, 60 or 120
well a bool on tick isnt a big deal especially if you’re already using tick,
a timer/timeline is also fine considering its temporary.
another option is to put it in an object/component/actor tick and destroy it when its job is complete
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.