# I would like to know the coordinates of the left and right side of the actor, within the Y axis.

**URL:** <https://forums.unrealengine.com/t/i-would-like-to-know-the-coordinates-of-the-left-and-right-side-of-the-actor-within-the-y-axis/2379060>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [March 7, 2025, 8:59am UTC](https://forums.unrealengine.com/t/i-would-like-to-know-the-coordinates-of-the-left-and-right-side-of-the-actor-within-the-y-axis/2379060 "2025-03-07T08:59:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [March 7, 2025, 8:59am UTC](https://forums.unrealengine.com/t/i-would-like-to-know-the-coordinates-of-the-left-and-right-side-of-the-actor-within-the-y-axis/2379060/1 "2025-03-07T08:59:23Z")

</div>

Hi!

I’m trying to understand how `GetActorBounds` works. To do it I have this actor:

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/a/d4aa83cfaaad72bd775b367cae794ff89ab1f207.jpeg)

It consists of two static meshes of 50x50x50.

The pivot point is on the middle of the left cube. The distance of each face is 25. And the location of the actor in world is `(0, 25, 800)`.

When I run this code:

```auto
FVector BoxExtend;
FVector Origin;|
GetActorBounds(true, Origin, BoxExtend);

```

I get these values:

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/8/6b84ec87e02609b702da66373bb83d8bf0c0d474.png)

Which I don’t understand. In particular, the value of Origin.Y. Is the Origin value a world space location?

And also, the box extend. Why the value of Y is 50? I think it should be 100.

I would like to know the coordinates of the left and right side of the actor, within the Y axis. The ones I’ve surrounded with a yellow ellipse.

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/f/c4f4720077c8b025541defb7897f53f9233210df.jpeg)

Thank you!

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 7, 2025, 9:52am UTC](https://forums.unrealengine.com/t/i-would-like-to-know-the-coordinates-of-the-left-and-right-side-of-the-actor-within-the-y-axis/2379060/2 "2025-03-07T09:52:02Z")

</div>

You are going to have to do some extra work to get the bounds depending on the actor rotation. I’m guessing you’ll want the left and right side no matter the orientation of the actor. If you just use actor bounds then once you start rotating the actor for instance 45 deg you will no longer get the side of the meshes

You would probably need to rely on get local bounds with some extra steps like shown here

> [@Oriented bounding box from GetLocalBounds](https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396/2):
>
> Figured out the box was off-center. Also figured out you can get the mesh from the meshcomponent and via that get to a bounds object. Came up with this in the meanwhile:

The extent only has half of the distance so 50 and not a 100 because it’s extending from the origin (the center of the actor in this case). Think of it like the radius of a circle. It’s not the distance from edge to edge but from the origin to the side of the bounding box.

Something like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/8/548889610c176ac080c30a4b82209eaf58dc0f4e.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/e/f0e165255c924c86a1df768ab7f5d808501fe860.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/a/66a978b21655e8f8c77926d49989cc38d8d945d9.png)

The centers of the debug boxes are the oriented points of the extremes of the mesh

Further changes in the code would depends on the use case. Are you rotating your components or scaling them etc.

* * *

For the full actor left and right:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/d/84de254526f1114c0b82c8cad7af977c545d09d1.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/5/2b596d05fe8a08bbb6195d6b6fe54bd904953598.png)

Because the bounding box is not oriented you have to temporarily set the rotation to zero to get the bounds =\> cache it =\> revert rotation and then rotate the vector to get the final output

**Simplified to just a function call:**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/f/f8ffaf834a526613f8a7a160565b9825a4692603.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/f/c8fb460a3b38ce3c3df711fec39ca80c7d151e71.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 6, 2025, 9:52am UTC](https://forums.unrealengine.com/t/i-would-like-to-know-the-coordinates-of-the-left-and-right-side-of-the-actor-within-the-y-axis/2379060/3 "2025-04-06T09:52:54Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
