# \-Random Point In Box- node orientation always default zero in world. How can I change this

**URL:** <https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [September 29, 2024, 5:52am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092 "2024-09-29T05:52:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [September 29, 2024, 5:52am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/1 "2024-09-29T05:52:18Z")

</div>

Hi, I have made an Actor Spawning Blueprint which consists of a -Spawn Actor from Class- node, a -Box Collision- and a -Random Point In Box- node oriented to the Default Scene Root. I get the extent of the box and pass the vector along to the spawn location of the -Spawn Actor from Class- node. Everything spawns, however the area in which the actors spawn, based on the Extent of the Collision Box, is oriented to the Default World Coordinates of 0,0,0 and not the defined Z orientation of the blueprint. Why is this and how can I change it to orient the spawn area in the rotation desired?

THX!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [September 29, 2024, 7:12am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/2 "2024-09-29T07:12:43Z")

</div>

It’s your code, not the node 😉

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/d/0cdbc6dfaad74d6784fc038346e16cc57fd91c14.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/d/21d55716f56ef634fc6dea0bb27839f516ce965a.jpeg)

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [September 29, 2024, 4:32pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/3 "2024-09-29T16:32:16Z")

</div>

Thanx for your quick reply, however even when using your code it is still not working. The -Random Point In Box- node asks for origin which is the Location of the bounding box but not the rotation of the bounding box. Is there a way to add the forward vector so that it knows where the box is facing?

If I use your code and rotate the bounding box in the world space the spawn area is still oriented to world rotation 0,0,0,. This is very visible when spawning 1000 or more actors. The bounding box (Outlines) is facing in the desired orientation but the spawned actors are oriented as a block (because there are so many actors being spawned) in the ,0,0,0 orientation.

what am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [September 29, 2024, 4:49pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/4 "2024-09-29T16:49:30Z")

</div>

I’m not talking about rotating each individual actor. I want the whole spawn area facing in the right direction. Example. I have a model of a pool facing 35 degrees on the Z axis in world space. I want to fill this pool wit 1000 Balls (Actors). Even though the bounding box is oriented and scaled exactly to fit inside the pool, when spawned some of the balls are in the pool but there are also lots not in the pool. This is because the box extent is oriented to 0,0,0. and not 35 degrees on the z Axis.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [September 29, 2024, 8:29pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/5 "2024-09-29T20:29:29Z")

</div>

It really depends if you’re rotating the actor, or just the box.

If it’s the actor, then my solution will work.

If you’re rotating the box, but not the actor, then you can get the world rotation of the box, that should do it.

I can’t try until tomorrow…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 1, 2024, 7:30am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/6 "2024-10-01T07:30:37Z")

</div>

Did you get this working?

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 7:09am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/7 "2024-10-03T07:09:25Z")

</div>

I don’t know if its a bug in unreal but I can’t get the actors to spawn within the box. see screenshot

Maybe someone knows what the problem is.

THX!

 ![ScreenShot00000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/a/cfac654fa0ae52aecb7a6c138bba2888c5eb0921.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 7:12am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/8 "2024-10-03T07:12:07Z")

</div>

Can you show your code?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 3, 2024, 7:15am UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/9 "2024-10-03T07:15:26Z")

</div>

> [@Pilleman22](#):
>
> Maybe someone knows what the problem is.

Are you using the Construction Script for this? Trying to read the transform of the box collision and use its data for the random gen?

@ClockworkOcean You helped me once with this.

* * *

@Pilleman22 Could you have a look and tell if this lines up with your experience:

> [@Why does the Construction Script refuse to report component offsets?](https://forums.unrealengine.com/t/why-does-the-construction-script-refuse-to-report-component-offsets/464489):
>
> Here’s an actor with a box component whose relative transforms are untouched. The Construction Script prints the location of the said component. That should print 0s and it does, of course. Below is an instance of the above actor in the scene, it has the very same component (thin line box) but it is offset by some 55000 uus. The actor still prints 0s when dragged around the scene when firing the Construction Script. I was expecting it to print 5…

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 1:01pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/10 "2024-10-03T13:01:57Z")

</div>

I think it must have to do with it NOT being called from the construction script. My suspicion is that the -RANDOM POINT IN BOX- node was meant to only be used in the construction script. (My Code Below)

I also noticed that the SPAWN ACTOR FROM CLASS node doesn’t work in the construction script, so using the construction script in my case is not an option. I also don’t know the location of my ACTOR SPAWNER BP before loading and it is set after the level has been loaded.

I’ve noticed a similar issue when using WORLD ALIGNED TEXTURES MATERIALS. The texture displayed is always oriented to X=0, Y=0, Z=0 and I still haven’t found a way to change the Z Rotation.

 ![Code](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/a/6cad450b20f933100f1bc945e30f60df01229edd.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 1:36pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/11 "2024-10-03T13:36:29Z")

</div>

You have to add the box rotation in, like I did above. That’s the problem…

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/12 "2024-10-03T14:48:10Z")

</div>

If I use your code I still get the same result. The box Z rotation =0 even though it is set to Z=43.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 2:53pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/13 "2024-10-03T14:53:05Z")

</div>

Can you show the code you get from that? Thanks.

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 3:37pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/14 "2024-10-03T15:37:56Z")

</div>

I am using your code. See screenshots. THX!

 ![Code](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/6/fc663fe4cd358bd107c62f93a8ab0a87becc9010.png)  
 ![ScreenShot00000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/7/1e790412f2fbf30d0bcf5fd5a82789b65da612e1.jpeg)  
 ![ScreenShot00001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/6/5/e65230ba17f87d8549e0587e4c8fe1aeec8773f2.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 3:42pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/15 "2024-10-03T15:42:26Z")

</div>

Are you changing the rotation of the actor ( the blueprint ), or are you selecting the box and moving that?

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 3:50pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/16 "2024-10-03T15:50:28Z")

</div>

I tried both. once turning it in the level and once in the blueprint. both have the same result.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 3:57pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/17 "2024-10-03T15:57:06Z")

</div>

If you rotate the actor it works. I don’t get it… ( the box should be unrotated in the blueprint )

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 4:39pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/18 "2024-10-03T16:39:27Z")

</div>

what do you mean with the box should be unrotated in the blueprint? do you mean it should be set to 0,0,0 in the blueprint?

---

<div class="post-metadata">

**Author:** ![Pilleman22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pilleman22](https://forums.unrealengine.com/u/Pilleman22)\
**Post date:** [October 3, 2024, 4:40pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/19 "2024-10-03T16:40:57Z")

</div>

I’m using UE 4.27. Could this have anything to do with it?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 3, 2024, 4:53pm UTC](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092/20 "2024-10-03T16:53:37Z")

</div>

Yes, the box should be at rotation 0,0,0 in the blueprint.

I don’t _think_ using 4 should affect things…

[Next page](https://forums.unrealengine.com/t/random-point-in-box-node-orientation-always-default-zero-in-world-how-can-i-change-this/2044092.md?page=2)
