RoundToInt or FloorToInt?

The first time that I wanted to see the grid positions in the console, I used RoundToInt, but it showed wrong positions according to the mouse position, so I changed it to FloorToInt, and it worked, but today I opened Unity and tested it again, and I realized it was giving me the wrong positions again, so I changed it to RoundToInt, and it fixed the problem. I want to know the reason for Unity’s behavior.

Unity’s behaviour is always the same. I posted about the rounding here;

From the post

This is always the case and will always give the same output for the same input. Perhaps share the code you used and we could analyse and see if we can get to the bottom of your issue

Privacy & Terms