- Home /
Resizing a mesh by its bounds instead of down-scaling it from center
I have a mesh of a floor that I am procedurally generating for my game, and I want to shrink the floor by half and make a copy of the mesh, the problem is that the floor is not guaranteed to be square and if I scale down the mesh to 0.5 which was my original plan it can cause some parts of the floor to clip through and not look accurate, here is what I mean:
Instead of just scaling the mesh down to 0.5 I want the bounds to shrink inwards by half so that the new mesh will always fit into the old mesh, so basically each vert of the mesh needs to pull inwards locally rather than towards the center of the object, because if it goes towards the center it can cause clipping issues like in the image attached.... hopefully that makes sense!
p.s. I probably just don't have the right keywords to google to get the answer to this, apologies in advance
Well, this isn't the *easiest* thing to do, but a starting point would be to look up info on "Inset Faces" (e.g. the name Blender uses for the process).
Since Unity doesn't have large-scale discrete "faces" for meshes, it means you'll have to sort out a lot of data-building yourself to make this sort of thing work, depending on whether you want it to be expandable.
This pointed me in the right direction, thanks I am currently working on a solution and will post an answer when I can
This forum post was also helpful link
Your answer
