Jump Delay

Jump Delay

When I set the 

pp->m_havokInput->m_wantJump = true;

There is no delay (well, one frame), between hitting the space bar, getting the space bar hit and setting m_wantJump true.

But there IS a delay of abput 1/8th second before the player appears to jump.

Any ideas on this?

2 帖子 / 0 全新

Hi Richard:

First of all, I'd like to point you a good "Jump Setup" demo: Physics/Test/Feature/Character/Character Weight , which maybe you have already known. :)

Second: I'd like to ask
1. what kind of character controller you are using , hkpCharacterProxy or hkpCharacterRigidBody ?
2. Are you usinig hkpCharacterContext as State Machine or you have your own state machine?
3. what timestep are you using (to step physics)
4. what is your actually framerate

I suggest you can double check the input of hkStepInfo::m_deltaTime and hkStepInfo::m_invDeltaTime if you are using hkpCharacterContext or hkpCharacterProxy.

In principle, if you are using hkpCharacterContext, it takes 3 physics step call from "HK_CHARACTER_ON_GROUND" to "HK_CHARACTER_IN_AIR"
1st: when ON GROUND, if m_wantJump, set the state to HK_CHARACTER_JUMPING
2nd: apply an impulse on hkpCharacterInput::m_up direction (state is still HK_CHARACTER_JUMPING)
3rd: change the state to "HK_CHARACTER_IN_AIR"

You can always trace the state by using hkpCharacterContext::getState() to see how many physics steps the game actually used from m_wantJump = true to "IN_AIR". If it is actually 3 calls and you do feel it is "very long" time, you might need to check your frame rate and how many physics step is called per frame.



Joe Developer Support Engineer Havok www.havok.com