So, Im making a basic grid placement system where a block is placed on where the player clicks.
My Objective Is: When a player clicks on a side of a already-placed block, a block will be placed in the side the player clicked.
The Problem: Well, it is working, but when I try to place the block in the bottom and in one of the sides, the block is not placed, it is placed inside the block I clicked.
Video:
My current code is:
if table.find(objects, block) then
local X = math.floor(mouseHit.Position.X/2 + 0.5) * 2
local Y = math.floor(mouseHit.Position.Y/2 + 0.5) * 2
local Z = math.floor(mouseHit.Position.Z/2 + 0.5) * 2
block.Position = Vector3.new(X,Y,Z)
end