Get Bounds of Mesh Component

Hi there,

got another problem: I have a Tile which is an Actor BP with a static Plane Mesh and I have a blueprint TileSpawner which spawns these Tiles in a grid. It all work pretty nice, but I had to hardcode the size (or bounds) of the plane in my TileSpawner Blueprint:

TileSizeX and TileSizeY are set to 100 (because I know that’s the size of the plane in x and y direction).

What I was wondering - is there a way to get the bounds of the static mesh in the Tile Blueprint dynamically so that I could reuse this TileSpawner for other Tile Types?

I mean, once the first one is spawned, I can get the bounds of the plane in it and use that as TileSizeX and TileSizeY, but that would mean I’d have to handle the first spawn outside of my loop (the blueprint from the screenshot runs in a loop over all Grid locations). Isn’t there a better way to do this? Like can I get the plane bounds from the Tile Blueprint definition directly somehow?




Maybe I misexplained that - I know about that function, but in my Blueprint, I’m creating the instances, but I need the bounds before the creation.

So, instead of picking an instances and getting the bounds from it, I’m looking for a way to just pass in the blueprint type and let my script detect the bounds used by the mesh in that blueprint type before creation of the instances.

You can use instanced static mesh components. You can get the component bounds of the ISM before you have spawned any instances.

Only works if you set the mesh on the node.

You could always spawn one, check it out, then bin it and jump into your loop.

Hi! i was looking for a bounding dimension of a hierarchy (a bunch of meshes) but this doesn’t work.
do you know how could be done?

What about?