Debugger shows stack error in if statement CONDITIONS line: i can’t realize why it is happening.
nearestenemy = FP.world.nearestToPoint("enemy", Input.mouseX, Input.mouseY);
if (magnetpower > 0 && GLOBALS.enemycount > 0 && nearestenemy.onCamera && FP.distance(nearestenemy.x, nearestenemy.y, Input.mouseX, Input.mouseY) < magnetpower)
{
targetlock = nearestenemy;
}