Float variable keeps resetting to its default value

maybe not the answer you are looking for but, have you tried print stringing all the values, 1 by 1 to make sure they are how you want them to be…?