How do i setup a Blocking Volume that was Spawned?

Hello, i’m trying to spawn a blocking volume in runtime, i’m doing this:

class ABlockingVolume * Blocker = GetWorld()->SpawnActor<class ABlockingVolume>(ABlockingVolume::StaticClass(), Location, Rotation);

How do i set the brush size properties? From what i found in the engine source code i have a:

UCubeBuilder* Builder = ConstructObject<UCubeBuilder>(UCubeBuilder::StaticClass());

But how do i tell the blocking volume to use it and set it’s size? Thank you.

Update: I’ve made some progress, i added the UnrealEd module so he recognizes the UCubeBuilder and then i do:

Blocker->BrushBuilder = CubeBuilder;

	CubeBuilder->X = 200.0f;
	CubeBuilder->Y = 200.0f;
	CubeBuilder->Z = 200.0f;

It compiles fine, when it’s created it has the right location and on the options it has the brush type Box with 200 for X, Y and Z, but it doesnt collide. When i place a manual Blocking Volume on the game and i select it, it draws 8 points, but mine doesn’t do that. I tried using:

CubeBuilder->Build(GetWorld());

But it didn’t make a difference. What am i missing?

i don’t think you should be creating blocking volumes at runtime, that is usually an editor thing, and its not just a box component that you can update any time you like, its some kind of BSP brush data.

you could make an actor with a box component set to block all, and spawn that actor, instead of the blocking volume. or if you need alot of these, you could have a manager actor that you spawn and attach box components to.

with a box component, you can use setBoxExtent, and you can move them around, rotate them, scale them, and do all sorts of things that you wouldn’t want to do with a BSP.

Yeah i also reached that conclusion. Thanks anyway :slight_smile: