Grid System Placement

Hello DevForum users!

I made a placement system which uses a grid of 1.
But, the models with an uneven size like 5, offset by .5 in the X and Z axis.

(For some reasson in my computer Roblox dosent allow me to login so ill take pictures via phone)

Model with size (5,5,5)

Model with size (5,5,6)

This is snapping code.

Finally i could log in, if you need any info please just tell me!

So i did a fix that could work, but its not ideal, so if anyone still haves any idea i would appreciate it.

if it has an uneven size then there is no way to put it in the center without the 0.5 offset

I think the only two solutions are:

  1. Design every model with even stud size
  2. For X and Z, add 0.5 if the size is uneven, which would look like
if Size.X % 2 == 1 then
  Position.X += 0.5
end

if Size.Z % 2 == 1 then
  Position.Z += 0.5
end
2 Likes

I dont think this is a practical solution but maybe if the size is odd move it by half a stud

1 Like

Welp, if theres a way to not make it center based would be cool, ill try this tho