2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: steps
[Re: Funeral]
#390723
01/04/12 09:35
01/04/12 09:35
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
Hi, check the manual:
move_min_z Determines the maximum size of steps or obstacles the player can step over using the OBB collision detection.
If the player collides with a polygon, the ellipsoid normal at collision point is evaluated. Collision with the floor results in normal.z == 1, collision at half the player size in normal.z == 0. For limiting the height the player can overstep, move_min_z can be set at a minimum z value. By default, move_min_z == -1, so a player can always glide upwards as long as the step does not exceed half his height. For overstepping only low steps, set move_min_z at a small positive value, like 0.4. Please note that the heights to overstep with a certain value depends on the actual player size. Range: -1 .. 1 (default: -1) Type: var Example: move_min_z = 0.4; See also: vglide, c_move, move_friction
|
|
|
Re: steps
[Re: Funeral]
#391433
01/12/12 00:44
01/12/12 00:44
|
Joined: Dec 2008
Posts: 83 Buenos Aires, Argentina
Funeral
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
|
this is the jumping code i'm using. i took it from AUM but maybe it needs to be fixed cause when i jumo on a block or model the player doesnt go downwards and it jumps again. its like when the player is in the air and reaches and obstacle beneath him the height sets to zero making it to jump again.
my code:
vec_set(temp.x, my.x); temp.z -= 10000; floor = c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX | GLIDE); // compute the distance between player's origin and the floor below its feet
if(joy_4 && floor < 30 && jump == 0 && J == 0) { jump = 1; } if(jump == 1) {
c_move(me,vector(0, 0, 20*time_step), nullvector, GLIDE); J = 1; } if(floor > 30) { jump = 2; } if(floor < 1 && !joy_4) { jump = 0; J = 0; }
c_move(me, nullvector, vector(0, 0, -1), GLIDE);
|
|
|
|