Download

Quick stupid question (Run construction script on drag)

Hi all,

where do I find this option?
I Searched an hour in the UE4 Editor without finding it :confused:

I have a normal Actor BP that does a lot of things in the construction script.
This shouldn’t be executed when I move the actor in the level.

Thanks in advance!

€dited to make more clear what I mean :slight_smile: (Thx@Narghile)

When you say Drag, you mean dragging the the BP around or dragging in a Variable.

Check the comment below out.

**JParent **Feb 15 '15 at 9:20 AM

Construction scripts are run within the editor, even when the game is not running (they are also run when the Blueprint is loaded at runtime/in-game). Every time you compile a blueprint or move a blueprint in your level,

Narg

Hi,

i mean moving the BP around in the Level.

I have a simple BP that spawns many blocks in the contruction script (to use as floor/wall for example).
Every time I move this actor in the level, the construction scripts runs and does its work (as it should).

But once I have the BP setup in the level, I don’t want it to change (for example a “set random color” of the added meshes) when i drag the actor in the level.

I read a few times about a button “Don’t run construction cript on drag”, and I hope this is what I need :slight_smile:

I do not know where this option is (and if its there at all), but You can do this yourself easily.

Make boolean variable “execute construction” expose it to editor.
Then very first thing do branch and check if its true.

There should be also some variable that tells if game is run in editor or its real runtime ie .game time or editor
Or you could create function library, and add function there that keeps that “execute construction” in there.
And use that function as kind of global variable.

Ps.
I do same trick all the time for stuff that i want snapped. Some actors always get to 0,0,0, some always stick to x-y plane. Some always snap to circle etc.
That circle thing is esp nice. I get vector of location to 0,0,0, normalize it then multiply by radius. And actor follows circle only.
Could improve it with variable that is center, and add that vector widget to it. Perfect snapping for planets.

Awesome easy solution :slight_smile:
Thanks!

I found the option you looked for, just click “Class settings” then its under the “Details” tab, first option.

Thanks. This works. Cant believe i missed this option

Not perfectly on point but since this is the first result google throws at people when searching for anything related to drag and construction scripts it might be be worth mentioning that there is still a bug where if you are dragging the component of the actor and not the actor the construction script will not run on drag. I ran into this problem just now and just couldn’t find a solution as to why would my construction script ignore dragging.

And then I’ve found this baby:
https://unreal-engine-issues.herokua…issue/UE-74108

I would really like it if it would fire if I was dragging the components too tbh… but never would have guessed that I can select the root component separately from the actor - especially since moving the root component moves the actor as far as I’ve seen it.