Skip to main content
typo
Source Link
DMGregory
  • 141k
  • 23
  • 258
  • 401

I ran into this problem. In my case the assets were anchored to their Center or so and therefore not properly grounded. The bottom-most pixel was the correct ground. And for some reason the bounds wasn’t correct. No idea why.

So I created a script. I looped through all vertices in the mesh and found the bottommost one. Then I calculated it’sits Y offset from the position of its transform. Then I created a new parent for this mesh’s transform at the same location. Then I adjusted the mesh’s transform’s local position to the offset calculated above.

I ran into this problem. In my case the assets were anchored to their Center or so and therefore not properly grounded. The bottom-most pixel was the correct ground. And for some reason the bounds wasn’t correct. No idea why.

So I created a script. I looped through all vertices in the mesh and found the bottommost one. Then I calculated it’s Y offset from the position of its transform. Then I created a new parent for this mesh’s transform at the same location. Then I adjusted the mesh’s transform’s local position to the offset calculated above.

I ran into this problem. In my case the assets were anchored to their Center or so and therefore not properly grounded. The bottom-most pixel was the correct ground. And for some reason the bounds wasn’t correct. No idea why.

So I created a script. I looped through all vertices in the mesh and found the bottommost one. Then I calculated its Y offset from the position of its transform. Then I created a new parent for this mesh’s transform at the same location. Then I adjusted the mesh’s transform’s local position to the offset calculated above.

Source Link
Adam B
  • 800
  • 3
  • 15

I ran into this problem. In my case the assets were anchored to their Center or so and therefore not properly grounded. The bottom-most pixel was the correct ground. And for some reason the bounds wasn’t correct. No idea why.

So I created a script. I looped through all vertices in the mesh and found the bottommost one. Then I calculated it’s Y offset from the position of its transform. Then I created a new parent for this mesh’s transform at the same location. Then I adjusted the mesh’s transform’s local position to the offset calculated above.