hi, i have this code for jumping but it needs to be fixed..
var alt = 20;
player script
var floor;
VECTOR temp;
vec_set(temp.x, my.x);
temp.z -= 10000;
floor = c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX | GLIDE);
{
if(floor < alt)
{
if(key_space)
{
c_move(me,vector(0, 0, 10*time_step),nullvector, GLIDE);
if(floor > alt)
{
c_move(me,vector(0,0,-1*time_step),nullvector, GLIDE);
}
}
}
its for jumping, and the idea its that when the player has reached the max altitud ( var alt = 20) the key has to get disable until the player touches the ground again, the problem its that the "if(floor < alt)" allows the player to jump not only when the player is in the air, but any moment as is in the air aswell.. so i dont know how to do to recognize when the player is on the floor to get the key to be able to jump again.