Answers for "Rigidbody slowly moves"
http://answers.unity.com/questions/920695/rigidbody-slowly-moves.html
The latest answers for the question "Rigidbody slowly moves"Answer by Baste
http://answers.unity.com/answers/921782/view.html
Don't add force in the direction of transform.forward. If you're looking straight down, transform.forward.x will be very close to 0, so doing this:
rigidbody.AddForce(new Vector3(transform.forward.x, 0 , transform.forward.z) * 50);
will give you a much lesser speed when looking down than when looking straight ahead.
The easiest thing to do is to remove the y-component from your forward-vector, and then normalize it. That will give you a vector that has constant length, no matter what the tilt of your look is:
Vector3 myForward = transform.forward;
myForward.y = 0f;
myForward = myForward.normalized;
if(Input.GetKey("w") && Input.GetKey(KeyCode.LeftShift) && !water1){
rigidbody.AddForce(new Vector3(myForward.x, 0 , myForward.z) * 50);
}
Do the same thing for transform.right.
I'd also suggest trying to reduce the immense amount of if/elses. Instead of checking left shift and water in every one of those, create a speed variable based on shift and water, and use that for what you multiply your speed with.Wed, 11 Mar 2015 23:12:44 GMTBaste