my block did rotate 90 degrees... i timed my.a_tilt to reach 90 when ab_tilt (bone.tilt) reached 90 degrees then the funcion would break; and the block would be at 90 degrees
while(1)
{
if(a_tilt == 90)
{break;}
my.ab_tilt =-10;
my.x +=7.5;
my.a_tilt +=10;
im using ent_bonerotate(my,"bone",vector(my.ab_pan, my.ab_tilt, my.ab_roll));
then i added *time like this
while(1)
{
if(a_tilt == 90)
{break;}
my.ab_tilt =-10*time;
my.x +=7.5*time;
my.a_tilt +=10*time;
but now i have to change ab_tilt == 90 to ab_tilt > 90 because it didnt break;
and not the out come of the block angle is random from 90 to 100 degrees
[QUESTION]
1.is there anyway to stop this?
2. if not, is there a way to snap the block to the nearest 90 degree angle
i.e
if outcome is 80 degrees snap to 90 degrees
if outcome is 100 degrees snap to 90 degrees
if outcome is 160 degrees snap to 180 degrees
if outcome is 470 degrees snap to 450 degrees
if outcome is -160 degrees snap to -180 degrees
could anyone please help me...
