hey, i'm working off a scripting tutorial for a fps, and i have a problem. I just completed my player's z trace so he can fall and land on platforms, but there is a problem. If he falls onto a map entity, a sprite, or a model he stops falling and can walk around on it. But if he lands on a terrain he falls right through it. Any idea what I should change in my code so he can land and walk on terrains? Thanks in advance!
Here is the part of the script that I think would be relevant to the problem:
vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_sprites+IGNORE_MODELS+USE_BOX;
My.fall_distance = trace(my.x,temp);
move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
If (my.fall_distance >64 && sign(my.fall_distance) != -1)
{
my.falling = 1; // now I'm falling
}
else
{
if ( my.fall_distance < 64 && my.falling == 0 )
{
move_vec.z = -my.fall_distance * time_step;
}
}
If (my.fall_distance >32)
{
my.falling = 1; // now I'm falling
if (move_vec.z > -15 * time_step)
{
move_vec.z -= .3 * time_step;
}
}