is there any way to get the current landscape size in unreal-units (or any other format) ingame? I basicly want to limit my camera to the size of the landscape so it does not fall of.
I want to get it ingame because i have multiple levels with different sizes …
I agree that the suggestion to use the bounding box is likely to work well for the exact bounds.
FWIW, what I do is put invisible walls at the edges of the world instead. Or, rather, slightly inside the edge of the world, so the player can’t see straight down without there being ground there.
Because calculation of aabb works in other ways than you think.
Because it’s dangerous to give advice to anybody without checking it by yourself, a less experienced person could waste tons of his time with wrong advice.
Yes you are wrong!
Box rotate along Z axis and Z dimension is constant, but X and Y changes, see scrn
Whose bounding box are you measuring? Are you rotating whole actor, or just a component?
Here, I’ll give you a freebie:
check the pivot of the rotating actor - you’ll notice landscape pivot is not at the center. Therefore, you have to manage the origin that the reading is taken from. Some basic math can get you the center of the object if you know it’s a square and you have the extents.
If you move the landscape or rotate it, you have to adjust for the difference there. But typically, no reason to move or rotate an landscape, in which the box extents gives you all the info asked for in original post.
You’ve added additional requirements beyond anything mentioned in original question, so if you want to know how to get size of an actor that is not typical landscape, that’s on you to make a new question if you need help.
But as mentioned, really no need for any math here when dropping a few collision borders into a map is all thats needed to accomplish the goal.
Might be a bit late, but you can just do a “GetActorOfClass” and set it to find the simply named “Landscape”, internally it is still an Actor, apparently.