How to set "Run Construction Script on Drag" in C++?

Does anyone know how to set an actor class’ construction script to not run while dragging, in C++? The option is available in the editor under Class Settings.

I’m not sure I fully understand what you’re trying to achieve but if you have access to the actual Blueprint you should be able to access the following member (and change it) as well.

If you look at AActor::PostEditMove in Engine\Source\Runtime\Engine\Private\ActorEditor.cpp you’ll see where and how it calls RerunConstructionScripts.

I want to set the value of that “Run Construction Script on Drag” boolean in C++ rather than blueprint, because it is important for performance reasons and I don’t want to have project members memorize that every time they make a blueprint based off my C++ class.

But that was exactly what I was looking for, thanks! Here is what I do now:




ATileDecorator::ATileDecorator()
{
	UBlueprint* Blueprint = Cast<UBlueprint>(GetClass()->ClassGeneratedBy);
	if (Blueprint)
		Blueprint->bRunConstructionScriptOnDrag = false;
}


5 Likes