jump

Posted By: episch

jump - 07/19/09 11:47

I wanna make a 3d jump and run but my problem is the jump part of the script in combination with the gravitation code.
Code:
function jump ()
{
	if(jump_hight<500)
	{
	
		dist_down=100;
	
	}
	else
	{
	
		dist_down=-1000;
	}
}
action spieler(){

vec_for_min(boden,me);
player = me;
	while(1){
		if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0){
			dist_down = my.z + boden.z - target.z;
		}else {
		dist_down = 0;
	}
	if (dist_down > 0){
	dist_down = clamp(dist_down,0,accelerate(speed_down,5,0.1));
	}else{
	speed_down = 0;
		if(!key_space)
			{
				dist_down=500;
			}
}var dist_ahead = 5*(key_w-key_s)*time_step;
c_move(me,vector(dist_ahead,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE| GLIDE);
if(mouse_pos.x < 640){
my.pan = 180;
}
else{
	my.pan = 0;
}

		camera.x = my.x ;
		camera.y = my.y -500;
		camera.z = my.z;
		wait(1);
	}
}





this code work not clean. my model is under the ground .


can sombody help my the fix this problem
Posted By: Rei_Ayanami

Re: jump - 07/19/09 11:56

set this at the start of your player code, c_setminmax(me);
Posted By: episch

Re: jump - 07/19/09 12:30

i have try this. the player stand now on the ground butthe player downt jump
© 2024 lite-C Forums