How stop 2d movement when object hit a wall

I created a square that slides on a flat ground.

public class PlayerMoveScript : MonoBehaviour
{

float move = 0;

    void Start (){}

    void FixedUpdate ()
    {
        if (move == 0) {
            move = Input.GetAxis ("Horizontal");
            if (move != 0) {
                move = 15*Mathf.Sign(move);
                rigidbody2D.velocity = new Vector2 (move, rigidbody2D.velocity.y);
            }
        } else 
            {
            rigidbody2D.velocity = new Vector2 (move, rigidbody2D.velocity.y);
            }

    }
}

On both sides of the ground lies a wall, when the square hits a wall and stops his movement, the square instead continues to push in his direction. What I trying to do, is that when the square hits the wall, the square stop the movement and stop to push on the wall, in a way that the player can choose a new direction until the square will hit a new wall.

So imagine a big picture frame, a little square lies on the center.

    • The player hit the down key
  • The square starts to move in the that direction, with a constant velocity
  • The square hits a side of the frame, and it stops
  • The player choose a new direction.
  • Back to 2

N.B: The walls are rigid bodies 2d with a box collider 2d.

I haven’t really dealt with this yet, but I could take a look if you package up the necessary assets!

Sorry for the silly question, I solved the problem.
The first issue were the proprieties of the object, they should respect precise settings otherwise their collision would not be captured.
The moving object is a Rigidbody Collider and the walls or the object that stops the movement are Static Colliders
(Unity - Manual: Box collider component reference)

The player can choose a new direction of the object only once the object has completed his last movement, to do so I used two variable;
moveHorizontal and moveVertical initialized to zero, the FixedUpdate method checks if at least one of these variable is equal to zero,
if this condition is true the method accept a new input direction, otherwise there is a movement goin’ on, and the program continues with that.
When the object hits the wall, the movement should stop, and moveHorizontal or moveVertical are set to zero.

This is in roughly how a I solved this problem.