Hi .. a simple question.
I have my character driven by a TContoller. Everything works as it should but there is one thing that I cant seem to fix. When stopping after have been walking (the move parameter to UpdateController is set to 0), my character does not stop at once, but continues sliding forward a little bit like she walks on ice.
// _height = 1.7
// _modelPos is the postion of my character model
TController _controller = CreateController( _height );
PositionEntity(_controller, modelPos );
SetBodyMass(_controller, 60);
SetBodyGravityMode(_controller, 1 );
// _walker.GetWalkSpeed() gives a speed factor
// _jumpHeight is a scale factor
// _rotY is amount of rotation around Y
float move = static_cast<float>(KeyDown( BackKey ) - KeyDown( ForwardKey )) * _walker.GetWalkSpeed();
float strafe = static_cast<float>(KeyDown( RightKey ) - KeyDown( LeftKey ));
float jump = static_cast<float>(KeyHit(JumpKey))*_jumpHeight;
UpdateController( _controller,
_rotY*timeFactor,
move*timeFactor, // contiues to move a bit event with move=0
strafe,
jump,
5,
10,
0 );
RotateEntity( _model, EntityRotation(_controller ) );
PositionEntity( _model, EntityPosition(_controller) );
I have tested with various body parameters like increasing the friction, but with no effect.
Any idea?