Add a "snap to grid" context action to restore minor displacements while building

As a Roblox developer, it is currently too hard to build large buildings because the copy/move tools are not perfect and they cause the disasterous 0.001 stud offset that cannot be fixed if any part in the selection is welded.

If Roblox is able to address this issue, it would improve my development experience because the dragger will allow me (and some other people) to create large buildings with no pain.

How I want the feature to work

There should be a “Snap to grid” button in the menu that appears when you click with right button on a part:
Capture
What it does is change the position of the part by rounding off it’s current position, depending on which step the user has selected. For example:

  1. I have a part that has coordinates 13, 6.2, 94.6 and my dragger step is 1 stud. I click with right mouse button on the part and select “Snap to grid” from the context menu. After this, part’s position is 13, 6, 95.
  2. My dragger step is 0.25 studs and I have a part with position 7, 1.052, 13.401. After snapping to the grid, part’s position is 7, 1, 13.5.

This can be done to multiple parts in the selection, snapping to the grid each part of it.

Why this needs to be implemented (my detailed problems with dragger)

My building style includes a lot of copying and pasting. And sometimes, when you copy and paste a part, there is a chance that it’s position will change by 0.001 stud and setting position manually doesn’t help if the part is welded. If that part is below another one or the selection includes few large parts, odds of happening this are almost 100%.
Changing part’s position from properties menu and breaking welds if the part is welded takes a lot of time. That’s why I (and those people who reported the 0.001 drag bug) need this feature.

6 Likes

This is one of the reasons why I use build tools plugins like SBS or Buildv4 or F3X so I can be certain objects are being positioned correctly as I have intended. Even having collisions set to off when using default studio tools will still try to take into account anything that currently has any priority over physics, such as welds that you mentioned.

On a related note, I also find that doing Ctrl + D to duplicate, is superior over Ctrl + C to copy and Ctrl + V to paste because with C+V most of the time collision will be applied and the part will instead of acting like CFraming a part, it will act like moving just Position, which puts parts on top of each other instead of inside each other in the exact same position the original part is located which would retain its original CFraming values. Ctrl + D also has the benefit of making the 2 parts share the same parent, instead of where simply copy and pasting would put the parent of the new part directly under workspace. However this I think has been resolved as I have noticed recently that objects get parented now to whichever item you currently have selected in the workspace.

3 Likes

Roblox Studio’s tools have struggled with drift since Studio 2013 and several attempt have been made to mitigate it. It seems the issues persist. As Dev_Ryan mentioned, the simplest way to manage this is to use plugins and avoid the default tools for moving, resizing, and rotating parts. He is also right about duplicating.

More tips to avoid drift include:

  • Drag models into the workspace instead of clicking - often times the dragging feature fails to work, and the part is inserted exactly as it was published, instead of moving/rotating to whatever Studio feels like.
  • When copying and pasting parts to different studio instances, paste into any service that isn’t workspace - I typically paste into ServerStorage or ReplicatedStorage, then reparent the parts to workspace.
  • Avoid unioning parts - the CSG V2 solver creates drift by design to resolve conflicts to create the solution.
1 Like

As far as a “snap to grid” option, I have used a plugin for many years to create this effect. Parts are snapped to a 0.05 stud grid. I can’t remember the angle snapping, but angled parts will be messed up anyway, as their positions don’t fall on a grid by design.

Install this as a local plugin:

local toolbar = plugin:CreateToolbar("rounding fixer")
local button1 = toolbar:CreateButton("Rounding Fixer", "Select the bricks and models you want to fix. Does surface-level fixes for control.","")

button1.Click:connect(function()
	local MySelection = game.Selection:Get()
	for _,i in pairs (MySelection) do
		scan2(i)
		if i:IsA("Model") or i:IsA("Folder") then
			for _, v in pairs(i:GetChildren()) do
				scan2(v)
			end
		end
	end
	game.Selection:Set(MySelection)
end)

local PositionResolution = .05
local RotationResolution = 5

function scan2(v)
	if v:IsA("BasePart") and v.ClassName ~= "Terrain" then
		local posx = math.floor(v.Position.X/PositionResolution+0.5)*PositionResolution
		local posy = math.floor(v.Position.Y/PositionResolution+0.5)*PositionResolution
		local posz= math.floor(v.Position.Z/PositionResolution+0.5)*PositionResolution
		local pos = Vector3.new(posx, posy, posz)
		local rotx = math.floor(v.Rotation.X/RotationResolution+0.5)*RotationResolution
		local roty = math.floor(v.Rotation.Y/RotationResolution+0.5)*RotationResolution
		local rotz = math.floor(v.Rotation.Z/RotationResolution+0.5)*RotationResolution
		local rot = Vector3.new(rotx, roty, rotz)
		
		par = v.Parent
		v.Parent = nil
		v.Position = pos
		v.Rotation = rot
		cfr = v.CFrame
		v.Parent = par
		v.CFrame = cfr
	end
end
1 Like

I tried this and it broke my entire build. I had to load an older version, thankfully I didn’t lose anything.

Have you found a solution to this issue? Its been bugging me for years and it makes building nearly impossible. My only guess on how to fix it now is to remove all welds and re-assemble it again. I wish I could figure out which weld is causing parts to shift. as when you fix that one part, its usually a chain that resolves itself.