- Home /
How to increase a slowing down speed?
Hi there! I'm using this code for player (a ball) movement. How to make it move more frisky? (increasing a speed variable is not a solution). For example, when player is moving one way and suddenly turn to the other (with this code) it's happening to slow. It's slowing down to slow ) How to increase this slowing down speed? Thanks!
void FixedUpdate () {
float moveHorizontal = Input.GetAxis("Horizontal");
// float moveVertical = 0.0f;
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rigidbody.AddForce(movement * speed * Time.deltaTime);
}
Answer by robertbu · Aug 08, 2014 at 12:48 PM
Select your object and increase 'drag' in your Rigidbody component. Then you will likely have to increase 'speed' some to compensate for the increased drag. The higher the drag, the faster it will change directions based on user input.
it's not exactly what I meant, but but I've figured it out! ) Thanks!
Your answer
Follow this Question
Related Questions
how to move player with getAxis and UI buttons 0 Answers
how to move player with getAxis and UI buttons 2 Answers
How to make Input.GetAxis(“Mouse X”) get a value even when the mouse is stopped? 1 Answer
Maintaining Run on direction change (double tap using GetAxis) 0 Answers
Unity 2d mobile movement 0 Answers