PhysX Questions

Posted By: bk9iq

PhysX Questions - 08/13/10 06:05

Hello all,

I usually don't post any question here in this forum but after I read " If your questions aren't answered elsewhere " below the "Ask The Developers" forum, I decided to ask here since I posted these questions in the other forums but got no answer.... sorry if it is the wrong place....

I made a simple physics code and used pXent_movechar(..) to move my player... However, I am having some problems here...

1-
I made an elevator as a physics kinematic object... I used pXent_kinematic ( entity, var active );
and moved it using pXent_moveglobal ( entity, VECTOR* vMove, ANGLE* aRotate);
However, the physics player doesn't move up and down or sideways with the moving elevator if I keep the player standing on it (( The elevator gets through the body of the player)) but If I walk or run on the elevator while it is moving up then everything works fine and the player moves up... ...
When I don't use physics I can solve it by making the player.z = elevator.z+100; but now I can't use xyz to move the player cuz I am using physics...
and I am using :
pX_setccd ( 1 ); in my main function and pXent_setccdskeleton(my, nullvector, 1); in my actions...
is there any way to fix this??

2-
Also, when I want to make my player jump up, it doesn't move up until my mov.z value becomes 393 and above ... when I try mov.z +=2; and use the debugger I could see that the player doesn't start to move up for any value under 393 and then when it becomes 393 it jumps up really fast to this value... is this a bug or I am doing something wrong?

Thanks

Posted By: jcl

Re: PhysX Questions - 08/13/10 10:25

Both solutions are the same as for non-physics, just with pXent_movechar instead of c_move. Move the player upwards when on an elevator, and also for jumping. I can't tell you why it jumps wrong, though. Maybe the gravity is too high. You can look into the many walking examples in AUM or on the resource page - most contain jumping code.

http://manual.3dgamestudio.net/pXent_movechar.htm
© 2024 lite-C Forums