Jumps and Physics

Posted By: bk9iq

Jumps and Physics - 07/21/10 05:42

Hello all,
I set a player as a physics entity:

pXent_settype(me,PH_CHAR,PH_CAPSULE);

as u can see the type is :PH_CHAR
however, when I am moving this character with :

pXent_movechar(me,move_diff , vector(rotate,0,0), 0);

everything is working fine except for the jumping... whatever I set move_diff.z to the player keeps itself on the ground and never jumps or moves up even if I turn the gravity function off.
If I put instead of move_diff a vector with x and y values of move_diff.x and move_diff.y and a z value of 200 the player stay on the ground and if I change this value to 500 the player goes to the ceiling directly ... IDK wut's wrong please somebody help... Am I doing something wrong with ?? How should we set jumps with physics?
Posted By: bk9iq

Re: Jumps and Physics - 07/22/10 15:28

Any Help PLZ??
Posted By: Alessandro

Re: Jumps and Physics - 08/18/10 21:58

In CAR.C source code, JCL used this function call to create a lift (to put the car in the right position after it crashed):

Code:
pXent_addforcelocal(car,vector(0,0,3000),vector(0,0,40));



Since that function call let the car make a small jump, I think you can use the same approach.
I hope this will help you!
Posted By: Random

Re: Jumps and Physics - 09/02/10 15:03

Try it with a invisible exlosion;

pXent_addexplosion (my, 0, 0, 500);
© 2024 lite-C Forums