hello again darlings, its me freakfish! and i’m back with yet another crazy illogical error.
Assets/Scripts/Characters/CowControl/CowControl.js(21,67): BCE0051: Operator ‘<=’ cannot be used with a left hand side of type ‘boolean’ and a right hand side of type ‘float’.
this is utter bollocks. why you may be wondering? well, none of the variables being used are booleans. they are ALL floats which is rather confusing. here is the script thats throwing up the error:
var samepos = 0;
function SamePositions ()
{
if (samepos == 0)
{
samepos = 1;
CowMove.move = -0.125;
CowMove.moveup = 1.5;
yield WaitForSeconds (1.5);
CowMove.move = -0.5;
CowMove.moveup = -0.5;
samepos = 0;
}
}
function Update ()
{
if (BeamTexture.on == 1)
{
if (UFOcontrolBox.ufoxpos -0.5 <= CowMove.cowxpos <= UFOcontrolBox.ufoxpos + 0.5) // this is the errored line
{
SamePositions ();
}
}
else
{
CowMove.move = -0.5;
CowMove.moveup = -0.5;
}
}
just so nobody gets confused (mainly me) here are the lines where the variables in the other scripts are being declared:
From CowMove;
static var move = -0.5;
static var moveup = -1;
static var cowxpos : float;
static var cowypos : float;
function Update ()
{
cowxpos = transform.position.x;
cowypos = transform.position.y;
...
From UFOcontrolBox;
static var ufoxpos : float;
function Start(){
ufoxpos = transform.position.x;
}
function Update ()
{
ufoxpos = transform.position.x;
so please help people! D: the computer is telling me i’m wrong when logic dictates i’m right! tell me whats going onnnn D: