Script bug
Posted: Fri Feb 26, 2010 1:16 am
I made an angle calculating formula based off 2 lasers hitting a box from either side, the box has 3 lasers pointed at it (2 for measuring angle 1 for spawning) and it can tell the difference between them, the problem is that this particular part of the script doesent really work
it goes through the part and in the end has no idea what anglez is, if i put scene.my.var=anglez inside the brackets it works perfectly but anything thats outside that if statement cant get access to anglez variable, this is driving me nuts since i dont see anything wrong with it
- Code: Select all
xdiff = textcolor(2) - textcolor(0);
ydiff = textcolor(1) - textcolor(3);
scene.my.var = anglez;
xdiff > 0 ?
{ ydiff = ydiff + 0.03125; anglez = ydiff / 0.0625 * 180 - 90 } :
{ ydiff = ydiff + 0.03125; anglez = 270 - ydiff / 0.0625 * 180 };
it goes through the part and in the end has no idea what anglez is, if i put scene.my.var=anglez inside the brackets it works perfectly but anything thats outside that if statement cant get access to anglez variable, this is driving me nuts since i dont see anything wrong with it