I'm having trouble making a character move faster than a certain limit using RigidBody2D.AddForce(). My game is a top-down 2D game (constrained to the x/y plane).
I'm using a float 'MovementSpeed' to scale a normalized vector passed to RigidBody2D.AddForce(), however, when I increase MovementSpeed past 1000, there's almost no noticeable difference in the object's "speed"; going from 100 to 1000 is a drastic difference, but there's almost no noticeable difference going from 1000 to 1000000. Here's my WASDMovement() function (called during FixedUpdate() ):
private void WASDMovement() {
Vector3 translationVector = Vector3.zero;
if (Input.GetKey(KeyCode.W)) {
translationVector += new Vector3(0.0f, 1.0f, 0.0f);
}
if (Input.GetKey(KeyCode.A)) {
translationVector += new Vector3(-1.0f, 0.0f, 0.0f);
}
if (Input.GetKey(KeyCode.S)) {
translationVector += new Vector3(0.0f, -1.0f, 0.0f);
}
if (Input.GetKey(KeyCode.D)) {
translationVector += new Vector3(1.0f, 0.0f, 0.0f);
}
translationVector.Normalize();
rigidbody2D.AddForce(translationVector * MovementSpeed);
}
Here's a video demonstrating my problem to make it easier to see what I'm doing wrong: http://youtu.be/9kwKvfDOYoo