So I made this grid placement system thingy and the block keep floating, so i decided to change the baseplate size and then it somehow works
The code:
local Player = game.Players.LocalPlayer
local plrChar = Player.Character
local mouse = Player:GetMouse()
function SetUp()
local NewBlock = script.Part:Clone()
NewBlock.Parent = workspace
NewBlock.Transparency = 0.5
NewBlock.CanCollide = false
return NewBlock
end
local Thing = SetUp()
function Round(Input, GridSize)
local X = math.floor(Input.X / GridSize + 0.5) * GridSize
local Y = math.floor(Input.Y / GridSize + 0.5) * GridSize
local Z = math.floor(Input.Z / GridSize + 0.5) * GridSize
return Vector3.new(X, Y, Z)
end
mouse.Button1Down:Connect(function()
Thing.CanCollide = true
Thing.Transparency = 0
Thing = SetUp()
end)
game:GetService("RunService").RenderStepped:Connect(function()
Move()
end)
function Move()
local target = mouse.Hit.p
local face = mouse.TargetSurface
mouse.TargetFilter = Thing
local norm = Vector3.FromNormalId(face)
Thing.Position = Round(target + (norm * 2), 4)
end

2 comments
idk but it works at 4, 12, 20, 28
Maybe a dumb question but why are there 4 numbers? - if you make the "4" smaller does it stop working? If yes then it's probably to do with rounding, just try to have your baseplate big enough or rethink your script :)