Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
jump #279801
07/19/09 11:47
07/19/09 11:47
Joined: Jul 2009
Posts: 16
E
episch Offline OP
Newbie
episch  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 16
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

Re: jump [Re: episch] #279804
07/19/09 11:56
07/19/09 11:56
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
set this at the start of your player code, c_setminmax(me);

Re: jump [Re: Rei_Ayanami] #279810
07/19/09 12:30
07/19/09 12:30
Joined: Jul 2009
Posts: 16
E
episch Offline OP
Newbie
episch  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 16
i have try this. the player stand now on the ground butthe player downt jump


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1