result = c_trace(vector(my.x,my.y,my.z - z_offset),vector(my.x,my.y,my.z - 4000),IGNORE_ME | IGNORE_PASSABLE );
if (result < 3 ) {force.z = -1 *result;}
else{force.z -= 6 * time_step;
force.z = maxv(-30,force.z);}
velocity.z += (time_step * force.z) - (minv(time_step*0.7,1) * velocity.z);
move.z = velocity.z * time_step;
c_move(my,vector(0,0,move.z),nullvector,IGNORE_PASSABLE| GLIDE);
result = trace(vector(my.x,my.y,my.z - z_offset),vector(my.x,my.y,my.z - 4000));
if (result < 0) { my.z -= result; velocity.z = 0; }
}
KHmovement turorial script used on my project a side from a samall jump out of the ground it works perfect. I changed it a little. Download the tutorial, Same methoid is used a lot by others.
hope I help sorry if not
Last edited by Malice; 08/27/07 07:37.