Roland Posted June 10, 2012 Posted June 10, 2012 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? Quote Roland Strålberg Website: https://rstralberg.com
macklebee Posted June 10, 2012 Posted June 10, 2012 increase the value of the maxacceleration parameter from 5 to something like 100 to 500... increase/decrease until you get something you like... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Roland Posted June 10, 2012 Author Posted June 10, 2012 Thanks mac.. That did the trick. Though I had tested everything..but apparently I had not Quote Roland Strålberg Website: https://rstralberg.com
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.