So i am trying to compare a variable that contains some negative numbers at random given times based on rotation and basically my if statement isn’t “catching” the negative cases and will only give the expected results if the number is positive what’s going on?
here’s what i have tried:
if (parseFloat(target.y) > -0.60 && parseFloat(target.y) < -0.70)
{
this._target.position.z -= 0.4;
this._target.position.x -= 4;
}
and also:
if (target.y > -0.60 && target.y < -0.70)
{
this._target.position.z -= 0.4;
this._target.position.x -= 4;
}
here’s the var which uses three.js to get the values if that makes any difference, values can be negative or positive im testing both:
var target = new THREE.Quaternion();
this._target.getWorldQuaternion( target );
thanks in advance for any help