Resize handle resizes in a funny way

Hi everyone!

As of now I am working on a building system, and one that is similar to ROBLOX Studio’s building system. One of the features is, of course… the resize feature!

However, there is one major flaw about this feature. And that is the way that it resizes.

Here’s a video of what I mean:
https://streamable.com/sj8zuf

As you can see, the block doesn’t resize in one axis, but instead resizes on both sides (and also moves a bit)

Here’s the code that is responsible for resizing:

v.MouseDrag:Connect(function(face, dist)
	if currentSelected then
		currentSelected.CanCollide = false
		
		currentSelected.Size = v3 + (Vector3.FromNormalId(face) * (math.floor(dist*10)/10))
		currentSelected.Position = pos - (Vector3.FromNormalId(face) * (math.floor(dist*10)/10))
	end
end)

I tried compensating for the “resizing on both sides” problem by moving the part a bit, but that didn’t seem to solve the problem…

And also!
For some reason, it also resizes depending on your camera angle for some reason…?

Please help!

1 Like

I forgot the exact equation but I had the same problem. What I ended up doing is getting out some paper and writting the position at a given size. From there I plugged my data into desmos and found out how from there. I think it is like you add half of the scale factor but like i said i forgot

Yeah, don’t worry about that part. I already kinda figured it out, but thanks for helping :^)