title: Issue with the c# script for player climb in unity
body: <p>I am trying to make the player to climb a ladder. (2D game)</p>
  
  <p>I used this code for that,</p>
  
  <pre><code>void OnTriggerEnter2D(Collider2D collider){
      if(collider.gameObject.tag=="Ladder"){
          _canClimb = true;
          _anim.SetBool("Climb",true);
      }
  }
  
  void OnTriggerExit2D(Collider2D collider){
      if(collider.gameObject.tag=="Ladder"){
          _canClimb = false;
          _anim.SetBool("Climb",false);
      }
  }
  </code></pre>
  
  <p>In the update() ,</p>
  
  <pre><code>if(Input.GetKey(KeyCode.UpArrow) &amp;&amp; _canClimb == true){
      transform.position = Vector3.Lerp(transform.position,ladderTop.transform.position,Time.deltaTime);
  }
  </code></pre>
  
  <p>I have put a child game object to ladder to get the position of the top of the ladder. </p>
  
  <p>But When the player jumps and hit with the box collider of the ladder I can see the climbing animation. And after that the player falls down to the ground again. It doesn't move up. What is the reason for that?</p>