Search Unity

Question [Netcode] Exponential floats notation causes an addition error

Discussion in 'NetCode for ECS' started by darioreal, Feb 7, 2021.

  1. darioreal

    darioreal

    Joined:
    Sep 24, 2020
    Posts:
    5
    In unity netcode example we can see the input(float)
    input.horizontal += 1;
    in my case i use a custom value...
    input.horizontal += custom_value;
    when custom_value is a value that c# forces to exponential notation like "-1.1E-05" the custom_value interpreted is not "0.0000001", it is "-1.1"... and the input is inconsistent

    How could avoid the c# exponential conversion on visual studio or in code?