Quantcast
Channel: Answers for "mathf.round problem"
Viewing all articles
Browse latest Browse all 4

Answer by Hellium

$
0
0
If you look at the documentation http://docs.unity3d.com/ScriptReference/Mathf.Round.html You will see that this function returns a float. Thus, there may be some imprecisions. I see two simple options : - Use [Mathf.RoundToInt][1] function - Format the output string value using [string.format( "{0:#}", clicks )][2] ; EDIT : Integers won't be a good solution in fact, since you seem to make a clicking game with auto-clicks, floating values will be necessary. [1]: http://docs.unity3d.com/ScriptReference/Mathf.RoundToInt.html [2]: https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>