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
Hmm, I'm not completely sure but I'd guess it's something to do with all of the rounding. How big does your baseplate have to be for it to work? And at what size does it stop working?