# Oriented bounding box from GetLocalBounds

**URL:** <https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [July 19, 2021, 4:26am UTC](https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396 "2021-07-19T04:26:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalmiya](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalmiya](https://forums.unrealengine.com/u/kalmiya)\
**Post date:** [July 19, 2021, 4:26am UTC](https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396/1 "2021-07-19T04:26:40Z")

</div>

Hello,

Rendering an (axis aligned) boundingbox using getcomponentbounds works nicely (below in green). To visualize my target-rectangle (red lines) I’m trying to get it a bit more tight by making an oriented boundingbox, using GetLocalBounds and rotating it (below in yellow).

However as is seen in the image, the yellow box doesn’t encompass the mesh, it is missing some offset. Any idea where to get that offset?

 ![ue4-bp-localbounds](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/4/14a10d9414b98b45b3a72d7c1e0b571e92116e30.png)  
 ![ue4-bp-localbounds-visualization](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/0/40e2454c7b52b5bab97569f1c3889039cdce9038.png)

---

<div class="post-metadata">

**Author:** ![kalmiya](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalmiya](https://forums.unrealengine.com/u/kalmiya)\
**Post date:** [July 19, 2021, 8:08am UTC](https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396/2 "2021-07-19T08:08:53Z")

</div>

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:

 ![ue4-bp-localbounds-visualization2](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/f/cf84ce5fc9cfd30e7d52ea6fca4c95c78f628b1b.png)

---

<div class="post-metadata">

**Author:** ![mrphilip246](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrphilip246](https://forums.unrealengine.com/u/mrphilip246)\
**Post date:** [April 29, 2022, 8:25am UTC](https://forums.unrealengine.com/t/oriented-bounding-box-from-getlocalbounds/241396/3 "2022-04-29T08:25:11Z")

</div>

Thanks for sharing!
