Invalid character input assertion

Invalid character input assertion


I've recently started implementing Havok into my game and I've run into an assertion that I can't seem to figure out. The error is as follows:

.CharacterControlStateMachinehkpCharacterContext.cpp(64): [0x6D4ABE44] Assert: input.isValid()
Invalid character input

Which seems weird to me, considering the following code I have constructing the input:

hkpCharacterInput input;
hkpCharacterOutput output;
	input.m_inputLR = -move.x;
	input.m_inputUD = -move.z;

	input.m_wantJump = want_jump;
	want_jump = false;
	input.m_atLadder = false;

	input.m_up.set(0, 1, 0);
	input.m_forward.set(unit->direction.x, unit->direction.y, unit->direction.z);

	input.m_stepInfo.m_deltaTime = dt;
	input.m_stepInfo.m_invDeltaTime = 1.0f/dt;
	input.m_characterGravity.set(0, -30, 0);
	input.m_velocity = characterProxy->getLinearVelocity();
	input.m_position = characterProxy->getPosition();

	hkVector4 down;	down.setNeg4(input.m_up);
	characterProxy->checkSupport(down, input.m_surfaceInfo);

// Apply the character state machine
characterContext->update(input, output);

I tried release mode to see if I could find any behavioural errors, but everything seemed to work as expected.

What's causing the assertion? Is there anyway to get more info on that? I'm using the latest free version of Havok.OgreMeshUpgrade tool.

3 帖子 / 0 全新

Hi Mustafa,

Are you sure that your 'move' variable has valid values? Also, is your timestep definitely greater than zero? Can you also check the value of m_surfaceInfo after the checkSupport to ensure it has proper values?Otherwise, your setup looks correct--hopefully it's one of those things. :)



Thank you for your reply Joel. The first frame had a timestep value of 0, which was causing the assertion in debug mode, but normal behaviour in release mode.