Is there a way to detect when an actor loses focus in the editor? I have a script which does some procedural generation and placement of actors based on a spline being manipulated. Unfortunately, when the spline gets long, the script is continually calling the creation event which produces a noticeable lag while moving the spline nodes. What I need is a way to run the procedural part of the script only when the spline actor is unselected and when the level loads.
I assume you have the construction script calling the creation event? You could just use an editable boolean variable that is hooked up to a branch node. If the bool is true, set the bool to false and call your creation event. That way the creation event will only be called when you set the bool to be true. Alternatively you can just turn your creation event into a blutility. You do this by selecting your event and enabling Call In Editor in the Details panel. Then just select the instance of the BP in the level and your event should be listed under the blutilities category.
As far as running the creation event when the level loads, just call the event on Begin Play.