Question by
sarrascaeta · Feb 11, 2016 at 04:46 PM ·
vectorsnappingrounding
Snap vector axis in script, like in the editor?
Unity has that feature where you can snap the axis within the editor.
How can I do that in C# script? For example, say I want to be able to snap the X and Y to the nearest .5 world unit.
-7.624
would become -7.5
11.2324
would become 11
9.89786
would become 10
3.456
would become 3.5
And so on.
Comment