How can I scale meshes according to a specific collision box?

I would like to scale a mesh in BPs, and make it fit a collision box, so if I have a model of a skyscraper or a coin, they would both fit inside that collision box. Nothing worked well so far (playing around with bounding boxes), what am I missing?

You can use the “GetActorBounds” node to get the half size for your meshes.

  1. Multiply the bounds of your mesh and collision box by 2.
  2. Divide these two vectors; The result will be the scale you need for your mesh.
  3. If you want to avoid stretching, just split the vector pins and connect the Z pin to X, Y, and Z in the SetActorScale3D node.
2 Likes

I did it. However, some more rectangular objects still get out of the bounds of the collision box. Did I do something wrong?

Fixed it! Thank you very much!

1 Like