Originally Posted By: Yking
Maybe because I am using 7.5 Extra Edition?

Sure

Originally Posted By: Yking
is also not working because there is no Entity or something called terrain (I am only speculating this, might be wrong).

You are right. The terrain entity of the example is created on the run some code lines earlier.

That function computes the mouse position over a plane. It is the absolute objetive of your character. You only need to substract the global entity position to get the relative movement vector.

Code:
var speed = 10;
VECTOR vecMove;
vec_diff ( vecMove, vecMouseGround, ent.x ); //Get the movement vector
vec_normalize ( vecMove, speed * time_step ); // x = v * t;
c_move ( me, NULL, vecMove, GLIDE );



The orientation is taken from the movement vector.
Code:
ANGLE angTemp;
vec_to_angle ( angTemp, vecMove );
my.pan += clamp ( ang ( angTemp.pan - my.pan ), time_step * -0.3, time_step * 0.3 );


Last edited by txesmi; 08/29/14 11:16.