Hi,
I'm having constantly problems to make a player script with good behavior when it comes to gravity and climbing stairs.
A simple ego perspective player script without any gravity:
function control_player()
{
while(my.skill1 > 0)
{
VECTOR move_dist;
move_dist.x = (key_w - key_s) * 15 * time_step;
move_dist.y = (key_a - key_d) * 15 * time_step;
move_dist.z = 0;
c_move(my, move_dist, NULL, GLIDE + IGNORE_PASSABLE);
my.pan -= MOUSE_SENSIBILITY * mouse_force.x * time_step;
vec_set(camera.x, my.x);
camera.z += EYE_HIGHT;
camera.pan = my.pan;
camera.tilt += MOUSE_SENSIBILITY * mouse_force.y * time_step;
wait(1);
}
}
Now I wanted to know how you are implementing a good gravity system that allows to walk on stairs? I know that there are many ways how this can be done and I know that there are many threads about this topic but I didn't managed to get a good result with any of the informations I got.
I don't want to use PhysX and I don't want to write my own collision system. All I want to use is c_move() and c_trace(). Additionally the code shouldn't be too complex (it's not important that the result is 100% perfect).
Thanks for sharing your experiences