You shouldn’t move the rigidbody if it isn’t marked as kinematic otherwise you get this unwanted behavior.
Try to move the transform instead of the rigidbody like this:
var keyboardSpeed = 10.0;
function FixedUpdate ()
{
var keyboardX = Input.GetAxis("Horizontal") * keyboardSpeed * Time.deltaTime;
var keyboardY = Input.GetAxis("Vertical") * keyboardSpeed * Time.deltaTime;
var newPos = transform.position + Vector3(keyboardX, keyboardY, 0.0);
transform.Translate (newPos);
}
You should handle the collision stuff in the appropriate unity function like OnCollisionEnter() or OnCollisionStay() etc.
Here is unitys example how to move things wiht inputs - have a look at it…