local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local PosX
local PosY
local PosZ
local Model = game.ReplicatedStorage.Crate:Clone()
Model.Parent = workspace
local GridSize = 5
local function snap()
PosX = math.floor(Mouse.Hit.X / GridSize + 0.5) * GridSize
PosY = Model.PrimaryPart.Position.y
PosZ = math.floor(Mouse.Hit.Z / GridSize + 0.5) * GridSize
end
local function Movement()
Mouse.TargetFilter = Model
snap()
Model:SetPrimaryPartCFrame(CFrame.new(PosX, PosY, PosZ))
end
Mouse.Move:Connect(Movement)
At the snap function, all it does is add 5 to the position. Why does adding + 5 not have the same effect?
