Random Point in Bounding Box - Spawn Actor

Hello everyone,
I am trying to spawn my characters within a box, using the node Random Point in Bounding Box.

I want them to be spawned randomly in XY axis, but I want to be aligned in Z axis…

I have been trying it but it seems I am not doing it properly
What am I doing wrong? am I using the right tool even?
Please let me understand what I am missing here, thank you!

1 Like

Just make this fixed

You can either put a constant parameter in there, or use the Z world coordinate of the box.

ahhhhh, ok!
what if I wanted to have the Z coordinate of the bottom face of the box?

I tried this formula to get the Z coord of the bottom face:
Get World Location Z value + Get Scaled Box extent Z value = Spawn actor Location Z
but then the spawned actors go to unexpected places…

Also, when if I add a constant value, is the value from the center of the box? or center of the top face of the box?

thank you!

The world coord of the bottom center of the box is given by

box

Yes, that’s what I meant!
thank you for the precision! you rock!

1 Like

Sorry, there is a different issue in the BP i previously presented.

So, aligning the actors do work.
But whenever I move the box away from the origin of the map, the spawned actors move out of the box. I don’t get why…

Box is at the origin

Box moved a bit away from the origin, so the sphere are spawned outside

it seems there is a multiplier to the spheres outboxing phenomenon.

The BP is exatctly the same as I showed before…

1 Like

I just tested this, and it’s fine

Of course, an easy way of limiting the Z, is just to make the box flat :smiley: