Announcement

Collapse
No announcement yet.

Box Component and Static Mesh Scaling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Box Component and Static Mesh Scaling

    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

    #2
    1. 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

    2. 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

    Comment


      #3
      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.

      Comment


        #4
        Originally posted by Shmoopy1701 View Post
        1. 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

        2. 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
        My material doesn't matter at all because I want my platforms to be plain white, thanks for your help anyways though

        Comment


          #5
          Originally posted by TheJamsh View Post
          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.
          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.

          Comment


            #6
            Originally posted by anikataylor_ View Post

            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 1*1*1 world units. Then scale and world units are equivalent.

            Comment


              #7
              Originally posted by anikataylor_ View Post
              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
              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.

              Comment


                #8
                Ok thank you both so much for your help

                Comment

                Working...
                X