title: How to stop transform position when condition meets in unity?
body: <p>I need someone to help me with transform.position in Unity3d. I am trying to stop tranform.position when M key is pressed. I tried with the below mentioned code but it's still moving in same speed.</p>
  
  <pre><code>public class Scroll : MonoBehaviour
  {
      private void FixedUpdate()
      {
          if (PlayerController.isDead) return;
          if (Input.GetKey(KeyCode.M))
          {
              transform.position += PlayerController.player.transform.forward * -20f * Time.deltaTime;
          }
          else
          {
              transform.position += PlayerController.player.transform.forward * -5f * Time.deltaTime;
          }
          if (PlayerController.currentPlatform == null) return;
          if (PlayerController.currentPlatform.tag == "stairsUp")
              this.transform.Translate(0, -0.06f, 0);
          if (PlayerController.currentPlatform.tag == "stairsDown")
              this.transform.Translate(0, 0.06f, 0);
  
      }
  }
  </code></pre>
  
  <p>In normal condition transform.position is working but when I press the M key it should be slow down as much as it should look like its stopped now. I think Else condition is running perfectly.</p>