Hi all, so I have a platform with a scene component as the root, a box component inheriting the root and a static mesh component inheriting the box. In my program, I change the extent of my box component but the static mesh doesn’t change with it unless I change the scale of the box component which I don’t want to do. Does anyone know how to get around this and make it so when I change the extent of my box the static mesh will set its scale to fit the box. Any help is much appreciated, thank you
-
not sure that setting extents on a static mesh box will work, because you would have to recalculate the texture UVs, scaling, tiling on different faces differently
-
you could use 6 independent planes instead of a box to work around (1), but UV recalculating would still be an issue, so maybe apply a material that you can dynamically set texture scaling and tiling to adjust for the box extents
Box Extents do not change the scale part of the boxes transform, they are separate properties.
Child components will not inherit or infer their own scale from it because it’s independent. If you want the box to surround the mesh, adjust the extents so that they fit the mesh at a scale of 1.0, then you can adjust the scale and both will scale and retain their relative size.
My material doesn’t matter at all because I want my platforms to be plain white, thanks for your help anyways though
Yes I know it’s just that I want to be able to change the length of my box in world space and my static mesh to follow because when I try to change to scale of the static mesh, it’s relative to the static mesh, so for example when I enter 2, it doubles in length and doesn’t go to the actual length of 2.
OK, for that case just make the box static mesh exactly 111 world units. Then scale and world units are equivalent.
Why don’t you just scale the box instead of changing the extents.
Transforms are relative because they directly inherit.
Your static mesh has no override of the box extents therefore will not do anything with its parent’s value of it.
Ok thank you both so much for your help