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