I'm trying to position LEGO-like bricks on a 3D grid according to the player's raycast and the size of the brick. Bricks with dimensions of even numbers (2, 4, 6, 8...) snap to the grid perfectly, but bricks with dimensions of odd numbers don't. How should I align these bricks correctly based on the player's raycast and the brick's dimensions? What kind of offset would I implement?
new_position = raypoint.snapped(Vector3(0.9, 0.3, 0.9))