Placement system posX is bit off grid

Hi i have been working on placement system but it seems to place model on grid weirdly and i don’t understand why texture on grid is good position x seems to go bit off and i tried different sizes of models but nothing changed

script

local Placement = {}

Placement.Startplacing = function(object)
	local Player = game.Players.LocalPlayer
	local Mouse = Player:GetMouse()

	local Slot = Player:GetAttribute("Slot")

	local GridSize = 2
	
	
	while Player:GetAttribute("IsBuilding") == true do
	
		wait(0.1)
		
		Mouse.TargetFilter = object
		
		object:SetPrimaryPartCFrame(CFrame.new(math.floor(Mouse.Hit.X / GridSize + .5) * GridSize, workspace:FindFirstChild(Slot).Borders.Grid.Position.Y + 1, math.floor(Mouse.Hit.Z / GridSize + .5) * GridSize))
	end
end

return Placement

i have no idea how to fix it and i couldn’t find solution so if you have anything please tell me

Might I ask why you add .5 to the x and z positions? Since you use math.floor() on it, it could be why the position is off.

Have you checked the position of the actual part that is your floor? It may be that the floor is offset than the actual math making it offset. Plus there are other collaterals like the scaling of the grid image.

For example, does it line up perfectly when you put it to a corner?

honestly i don’t really know problem is that i was going with tutorial but i tried to put it away and like nothing changed

(sorry for late reply)

so i just moved texture and its okay now working perfectly fine i just was too tired to get this idea