How do i make the placement more correct and accurate?
Heres my script so far:
Run.Stepped:Connect(function(plays) if builded ~= nil then if builded.Type.Value == "Wall" then local mag = math.huge local grid for i, v in pairs(game.Workspace.Grids:GetChildren()) do local magger = (player.Character.HumanoidRootPart.Position - v.Position).magnitude if magger < mag then mag = magger grid = v end end builded.CFrame = grid.CFrame * CFrame.new(0, 0, -10) builded.CFrame = builded.CFrame + Vector3.new(0, 2.84, 0) end end end)
Heres a video of the result
https://gyazo.com/fbb783805eb280d6dffedae7f202fa3d
So how do i fix it?
thanks
The problem might be in the CFrame manipulation you do after you chose the grid point. Remove line 18 and replace line 9 with
local magger = (player.Character.HumanoidRootPart.CFrame * Vector3.new(0, 0, -10) - v.Position).Magnitude