0
\$\begingroup\$

I just noticed that unities snap-to-grid feature results in a strange behavior. The results are not precise. My geometry is comprised of 32x32 pieces. They appear to snap fine to the grid, but when I look at the location at the top right, it does not show a correct increment of units. There's evidently some measure of rounding happening. Here's a picture:

enter image description here

Does anyone know why unity's snap-to-grid feature isn't precise? I can get past this from a game dev standpoint, because movement in my game is not going to be grid based. However, I would really like the results of snap to grid to be more precise.

Thanks.

\$\endgroup\$
4
  • \$\begingroup\$ It seems like the Unity Grid is just really inconsistent. \$\endgroup\$
    – Krythic
    Jun 25, 2022 at 18:52
  • \$\begingroup\$ I just figured out that if I align something to the grid. Using the align to buttons. It snaps correctly to the grid and then can be translated correctly. I have no idea why clicking the align buttons are required though. Thankfully, I can just snap to vertex after this to make things go a lot quicker. \$\endgroup\$
    – Krythic
    Jun 25, 2022 at 18:58
  • \$\begingroup\$ Want to post that as an Answer? \$\endgroup\$
    – DMGregory
    Jun 25, 2022 at 19:19
  • 1
    \$\begingroup\$ @DMGregory Nope. \$\endgroup\$
    – Krythic
    Jun 25, 2022 at 22:32

1 Answer 1

1
\$\begingroup\$

I was having a similar problem with a grid of 0.5 and I found out that it's a problem with the tiny input field for the grid settings. When I try to enter 0.5, it actually puts 0.50001 (this is because it interprets my initial zero as my desired input, when is an impossible grid division, so it defaults to 0.00001) then typing the .5 after the zero will replace the first zero after the point with 5, resulting in 0.50001, however, the input field is so small that the tiny one at the end of the number was cut off, so I didn't see it, and I didn't think much of the two zeroes after the 5 which I could see.

I'm not sure if you're having the same problem since you're using a 32 grid, but maybe there is just a hidden decimal back there. I hope this can help someone.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .