Else never gets met

Posted By: Anonymous

Else never gets met - 09/10/15 20:56

else never met, object is a cube 4 units. Anyone tell me why?

Code:
if(vec_dist(my.x,vec_temp)>16)
{
c_move(my,nullvector,vector(vec_temp2.x*time_step,vec_temp2.y*time_step,vec_temp2.z*time_step),IGNORE_PASSABLE);
}
else
{
  vec_set(my.x,vec_temp);
  wait(4);
  ent_remove(me);
}

Posted By: Uhrwerk

Re: Else never gets met - 09/10/15 21:14

Because the vector distance is always greater than 16? How do you initialize vec_temp?
Posted By: Anonymous

Re: Else never gets met - 09/10/15 21:29

Uhrwerk thank for the reply.
Yes you were pointing the right issue. Vec_temp and vec_temp2 point to different things.
with vec_temp being the target point and vec_temp2 being a normalized speed for the difference between current place and target point.
Vec_temp2 ,work to get the object to the target, however vec_temp became changed so no longer held the target point.

Anyways thank for the reply.
© 2024 lite-C Forums