i keep seeing this code on scripts it says like mathf.round and im just wondering wat it is and is there any documentation on it thx
2 Answers
2Yes. Always check the scripting reference first when looking for documentation on Unity3D. It even has a search field where you can search for "Mathf.Round".
It rounds your float to the nearest integer so if you have a 5.6 valued float Mathf.Round(5.6) would return 6. Mathf.Round(5.4) would return 5. If the number ends in .5 so it is halfway between two integers, one of which is even and the other odd, the even number is returned.
I would suggest using the local version of the docs. Loads up instantly, no waiting between searches etc. My local address is like below... file:///C:/Program%20Files%20%28x86%29/Unity/Editor/Data/Documentation/Documentation/ScriptReference/index.html
– SarperSSure, you can use the local copy but the online version is always up-to-date and i never use the internal search. I just use google to search ;) much faster.
– Bunny83Yeah, the search on that site is incredibly slow. I also google for "unity3d reference Mathf.Round" rather than going to the refs.
– Statement@Sarper: You could just click Help/Scripting Reference.
– Statement