How to detect click on a tile?

I use this round function to handle clicking blocks in negative coordinates properly.

function round(num)
	if num > 0 then
		return math.floor(num + 0.5)
	else
		return math.ceil(num - 0.5)
	end
end
1 Like