Masx
21-05-2008 18:28:29
I'm creating a racing game at the moment and using an xbox control pad with OIS for the input to the game, and the vehicle prefabs for movement.
The shoulder analogue buttons are used for the acceleration/brake input
now this works fine no problem at all... until the velocity of the goKart (ODE prefab vehicle) reaches exactly 0. the inputs begin to have no effect on the vehicle, even though i can see the axis values of the inputs changing on screen.
if i use the keyboard input instead, and the vehicle reaches 0 velocity, upon pressing the acceleration key it moves.
so why does the controller have no effect on the vehicles input, only when, the velocity reaches 0?
The shoulder analogue buttons are used for the acceleration/brake input
if( mJoy ) LeftAxisValue = mJoy->getJoyStickState().mAxes[LEFT_THUMB_LR_AXIS].abs;
if( mJoy ) RightAxisValue = mJoy->getJoyStickState().mAxes[SHOULDER_ANALOGUE].abs;
if( mJoy ) LeftAxisValue = (LeftAxisValue / 32768);
if( mJoy ) RightAxisValue = (RightAxisValue / 32640);
if( mJoy ) goKart->setInputs(LeftAxisValue,RightAxisValue);
now this works fine no problem at all... until the velocity of the goKart (ODE prefab vehicle) reaches exactly 0. the inputs begin to have no effect on the vehicle, even though i can see the axis values of the inputs changing on screen.
if i use the keyboard input instead, and the vehicle reaches 0 velocity, upon pressing the acceleration key it moves.
so why does the controller have no effect on the vehicles input, only when, the velocity reaches 0?