I spent a while making a tool that places blocks at the position of the mouse for my building game, and there is no errors. but for some reason, the tool does not place blocks on any -axis face of a part. I could not find any solutions for this, so here is the script.
wait()
script.Parent.Activated:Connect(function()
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local NewPart = Instance.new("Part")
NewPart.Size = Vector3.new(1,1,1)
NewPart.Parent = workspace
NewPart.Anchored = true
NewPart.Position = Vector3.new(math.round(Mouse.Hit.Position.X), math.round(Mouse.Hit.Position.Y), math.round(Mouse.Hit.Position.Z))
NewPart.Position = Vector3.new(NewPart.Position.X, NewPart.Position.Y + NewPart.Size.Y/2, NewPart.Position.Z)
print(NewPart.Position)
end)
and here is a vid showing how it’s not working:
here