I’m talking in terms of processing power.
I have an UI widget displaying “Press [F] to use” whenever my trace generates a hit. My trace is set to activate on event tick.
I can either:
-
Create the widget and add it to viewport every time a hit is generated (with the help of a bool variable to check if it is already up), and remove the return value from parent if no hits are being generated
-
Create the widget and add it to the viewport once on event begin play, hidden by default, and use the IsVisible function to determine whether I should set it to visible.
The blueprints to better explain what I mean:
What is the more efficient solution? Or is there a better solution altogether? Thank you.