negative float value

Having one of those days when something is not working, ended up resorting to commenting out code to find out which bits don’t work in the end after several hours I have just one line of code and it’s not working.

//
var k:float = -1;
function whatTheHellIsGoingOn()
{
print (k+" this is -1 wtf");
}
//

this returns: 0 this is -1 wtf

Thats right!!! I can’t set a float to -1.
I give up.

Is there any other part of code where you perhaps interact with k? Like setting value in Start() or Update()?

Please use code tags when sharing code, as it makes it much easier to read and figure out where you may be going wrong.

Try var k : float = -1.0f;

1 Like