Upgraded to 4.0 >>> Operator '-' cannot be used with a left hand side ....

static function LinStep (min,max,v) : float
{
var x = (v - min) / (max - min);
return x;
}

BCE0051: Operator ‘-’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘Object’.

Just a simple math function?

Any help would be appreciated!

Thanks in Advance,
Oliver :slight_smile:

Nevermind! :slight_smile:

Have to declare type…

Seems that 4.0 just got a lot stricter , which ain’t no bad thing. :slight_smile:

static function LinStep (min : float ,max : float ,v : float) : float
{
var x = (v - min) / (max - min);
return x;
}

4.0 is no more or less strict than 3.x. It has exactly the same behavior for JS code; the only way that code would cause an error is if you put “#pragma strict” at the top, or if you switched to iOS publishing, which automatically compiles everything as if it was using “#pragma strict”.

–Eric