Float variable keeps resetting to its default value

I gave that a try but no luck. Thanks for the idea though.