Call set visibility from tick event only once?

Hi there,

In my menu system you can switch between characters in a preview window. I am going from a tick event and when ever the conditions have changed I will adjust the visibility accordingly.

My question though is if it is necessary (in terms of performance) to deactivate setting the visibility once it has been called… it’s a little complicated, so take a look at this example below:

The question in this case would probably be, if is it harder to check the bool rather than to set the visibility. I would appreciate an answer because I would like adjust my scripting style accordingly.

Thanks a lot!

There is a DoOnce node that can only be executeted once unless you reset it.

https://docs.unrealengine.com/latest/images/Engine/Blueprints/UserGuide/FlowControl/DoOnce_Example.jpg

Here is some further explanation. When you execute this node, it will only execute a connected node once and then never again, unless you execute Reset.

This pretty much does exactly what you have done but it looks more clean. It is also very cheap on the performance you do not need to worry about performance issues.

Thanks a lot, I didn’t even know such a node exists…

does the game is lagging more about the “sequence and do once” in the event tick?

i think he has to check all time, if it is open or not and thats my worry.

Great! thanks!!