Why does my rigidbody character get "pushed" by terrain?

I'm having a tough time resolving this one.

I have a character who has a rigidbody attached and is moved around by adding force. This is all work great. However, if the character walks into a wall or some hills it seems some external force is being added to the character from the wall/hill which is causing the character to start moving strangely (typically away from the wall).

Just so it's clear this is the behaviour I am seeing:

  1. Character walks into the wall
  2. User stops pressing any arrow keys which should stop the player moving
  3. The character continues to move due to some force being applied after hitting the wall

This only happens after the character walks into another object. Any ideas as to how to stop this happening and to negate any external forces to the player except from player input?

You could check if there is a "bouncy" physic materials applied to the colliders.

Set your rigidbody to isKinematic = true.

If isKinematic is enabled, Forces, collisions or joints will not affect the rigidbody anymore. The rigidbody will be under full control of animation or script control by changing transform.position

http://unity3d.com/support/documentation/ScriptReference/Rigidbody-isKinematic.html

Although if you still want to apply forces to your character using addforce etc, then you will need to counter any forces on collision manually.