Get Extents of a Static Mesh

Hey,

Trying to find where the far left/right extents of a static mesh are. Get Local Bounds sounds like it would do it, but either I’m not sure how to use the result or it’s not what I’m looking for.

Example: I need the two red dot locations here:

66465791248ed0f9f333539f2d33e8e1a59342b5.jpeg

1 Like

Yeah, Get Local Bounds should do. It takes the pivot as 0 and gives the location of the each side of the bound relative to it, so in your case adding Min and Max values of the Y axis will give you that distance between each points.

1 Like

Ah, I understand how it works now - thanks.

Also a note for anyone else who reads this, you have to multiply the vectors from Get Local Bounds by the scale of the object to get the world space bounds.

4 Likes

Hrm, I have an issue with this.

If my object is at 0, 0, 0. And it’s scale is 9, 9, 9. And it is a cube of 1cm:

Get Local Bounds min will return -0.5, -0.5, 0
Get Local Bounds max will return 0.5, 0.5, 1

Then if we multiply the min/max by the scale of 9 then we get:
Min: -4.5, -4.5, 0
Max: 4.5, 4.5, 9

And that is fine, by multiplying by the scale we compensate for the fact it is performed in local space.

Except… Then I rotate by 45 degrees on Z.

How do I get the correct location of the bounds now? They’re placed as if the object is not rotated.

5 Likes

Nevermind, I have solved it.

Rotate Vector Around Axis on the Min/Max fixes it.

6 Likes

what?
blueprint or c++ code?

You’re replying to a post that was made 10 years ago

You’re replying to a comment that will never be seen in a google search result, but I am. Especially if the answer is posted.

I know because it was the top search result for my query.

As I said, it was over 10 years ago. I do not have any recollection of this and your question didn’t make sense, but it doesn’t matter, because it was over 10 years ago.

1 Like