Im Trying to make a custom grid placement system without the use of the tutorials that i dont understand and to see if I can simplify it so,
--The script is small
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Grid = game.Workspace.Grid
local GridSize = .5
local Marker = game.Workspace.Marker
local PosX = Marker.CFrame.X
local PosY = Marker.CFrame.Y
local PosZ = Marker.CFrame.Z
mouse.Move:Connect(function()
if mouse.Target == Grid then
mouse.TargetFilter = game.Workspace.Marker
Marker.Position = Vector3.new(math.floor(mouse.Hit.X / GridSize + .05), mouse.Hit.Y, math.floor(mouse.Hit.Z / GridSize + .05))
end
end)
So Here is the Grid issue The marker goes off the actual grid how does one prevent that

2 comments
I think you've messed up the math.floor(mouse.Hit.X / GridSize + .05) and math.floor(mouse.Hit.Z / GridSize + .05) lines. Test with this instead: Vector3.new(math.floor(mouse.Hit.X - GridSize), mouse.Hit.Y, math.floor(mouse.Hit.Z - GridSize))
pls dont flag for spam but hi ankur <3 its ur boi