I try to move an object (duh) when it reaches target (or a boundary), it should turn itself into another direction and then move on...
I'm using this:
CODE
float new_x = (float)randIntBetween(1, (integer)gMaxDistance) / 2;
if(new_x > 64.0)
new_x = 63.0;
float new_y = (float)randIntBetween(1, (integer)gMaxDistance) / new_x;
if(new_y > 64.0)
new_y = 63.0;
llSetRot( llEuler2Rot( <0.0, 0.0, llFrand( PI ) - PI_BY_TWO> ) * llGetRot());
llSleep(1.5);
vector target = llGetPos() + <new_x, new_y, 0.0> * llGetRot();
vector target is obiviously the new target I'm moving the object to.
To my understanding, the object should alwas go «forward», but sometimes it goes sideways as well. What am I doing wrong?
Thanks for your help...

