Currently I am making a scaling system with the ‘Handles’ instance. It is for some reason scaling both sides of a part when I select one side, though.
Video:
Location:
Code:
local scaleHandle = script.Parent
local block = script.Parent.Adornee
scaleHandle.MouseDrag:Connect(function(face, distance)
if face == Enum.NormalId.Left or face == Enum.NormalId.Right then
workspace[block.Name].Size += Vector3.new(distance, 0, 0)
end
if face == Enum.NormalId.Top or face == Enum.NormalId.Bottom then
workspace[block.Name].Size += Vector3.new(0, distance, 0)
end
if face == Enum.NormalId.Front or Enum.NormalId.Back then
workspace[block.Name].Size += Vector3.new(0, 0, distance)
end
end)
Unfortunately, your video didn’t quite load for me. Is the Script local? That would be needed instead of a server script. You also need to add where it changes the position along with the size, that’s how you can replicate the movement of 1 side only.
If I remember correctly, I could be wrong, the distance to Change Positions needs to be half of the size distance change
Where oldSize is obviously the initial/old size of the part and increment is the amount of studs to increase by. This eliminates the need for the if statements
For some reason, it still acts pretty buggy.
Code:
local scaleHandle = script.Parent
local block = workspace[script.Parent.Adornee.Name]
scaleHandle.MouseDrag:Connect(function(face, distance)
if face == Enum.NormalId.Left or face == Enum.NormalId.Right then
block.Size += Vector3.new(distance, 0, 0)
block.Position += Vector3.new(distance / 2, 0, 0)
end
if face == Enum.NormalId.Top or face == Enum.NormalId.Bottom then
block.Size += Vector3.new(0, distance, 0)
block.Position += Vector3.new(0, distance / 2, 0)
end
if face == Enum.NormalId.Front or Enum.NormalId.Back then
block.Size += Vector3.new(0, 0, distance)
block.Position += Vector3.new(0, 0, distance / 2)
end
end)
Sorry, I never made it back to my computer. Anyways, I found out that the resize tool was the only unfinished one, it’s really buggy and the right and bottom handle scales the opposite way, aswell as the part scaling on both sides.