How can I prevent this behavior with sizing

When sizing a part, it goes to 0.001 when sizing all the way down. Very inconvenient, how should I go about detecting this?

Code:

HandleScale.MouseDrag:Connect(function(id,distance)

	local delta = distance - MousePrev
	local delta2 = math.abs(delta)
	if delta2 > 1 then
		local sizD = math.round(delta)

		local canCollide = HandleScale.Adornee.CanCollide
		HandleScale.Adornee.CanCollide = false
		
		if HandleScale.Adornee:Resize(id,sizD) then
			MousePrev = distance
		end
		
		HandleScale.Adornee.CanCollide = canCollide

	end

Just make a minimum for the resize. If the size goes below the minimum make it equal the minimum.

Well, it resizes based on the face so how do I get the size of the side of the face to see if the side of the faces size - new face size is lower than incremental and if it is to not size it

The size of the side of the face would be either the X, Y or Z of the part’s size. You can check if the current side’s size - incremental >= 0.001 to make sure that you are able to lower the size by the incremental. 0.001 is the smallest the part can go which is why it is stuck at 0.001. if you want it to go to zero I suppose you can check if current side’s size - incremental < 0.001 then set transparency to 1.

I want my part to clamp at incremental, .5

image
this will happen when scaling down, I want it to clamp like this:


and not able to scale down any further.

Oh, I see what you mean now. You can check if the current side’s size - incremental >= incremental and if so, allow it to change, if not, then set the side’s size to the incremental.

how do I get the sides size?ggg

Part.Size is a vector3 value. Check to see if any of the 3 values of the part you are working on have a size of .5 or less and then set it back to .5.