Event Adds Random atomic number to variable without any reason (SOLVED)

Hi, i was trying to make combo system that multiply actual score, score is 1 at start and not changing and combo counter too 1 at start and if you succesfully dunk ball it increase 0.1 and you get 1.1 score, if you dunk again you get combo counter increase another 0.1 and you get 1.2 score for dunk but its adding random numbers to variable without any reason what could cause this?


Welcome to the world of computers and floating point imprecision, also known as Round-off errors. :frowning:

Most programming languages are victim to this. Not a lot you can to do stop it from happening whenever dealing with decimals/division/etc, but you can eliminate it by using the roundTo() expression around your math, and deciding what maximum decimal you wish to allow.

1 Like

Thanks, i was not knowing that :smiley:

1 Like