Resize MeshPart.Y?

I’m working on a Cubic terrain system and I’m currently looking for a way to have the ‘Cells’ always touch Y position 0 regardless of size - This allows for stuff to be hidden and smoother when extruding parts.

I’ve tried .Magnitude but having no luck as of yet - I want to maintain the initial height and Position, just have it touch vector3.new(Part.Position.X, 0, Part.Position.Z).

Thank you

if your “cells” are just cube parts, then it’s just a pretty simple math problem.
unless you specify otherwise, the origin of your part (where the x and y will be) should always be at the very center, like so:

(i hope this is what you mean, if not, correct me)

lets say one of my cubes’ tops will be at 2 studs. i know it’s 2 studs because thats the difference of the top of the y value (2) from the bottom y value (0).

well, we should move the block to the center of that 2 studs height (1 stud, half of 2), and then we can finally size up the block to that 2 studs height. since the origin remains at that center, roblox will just pull the top and the bottom equally to get to that height.

if you decide to change the origin, all you have to do is calculate where the middle spot is going to be instead! i’m pretty sure this works on meshes as well, youll just have to mess around with the origin first, i believe.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.