title: C# Multiple If Statements
body: <p>I had been working in Unity 2D to try and write programming for a top down RPG. The problem I've run into is that C# does not seem to understand my if statements. I have set up multiple if statements and a single else statement, but the else statement only takes effect on the statement written just above it. Its kind of like the other if statements are pushed off to the side as seperate lines of code, even though i want the else to take effect on all of the if statements. I'm sorry if this sounds confusing, I'll just place my code below if you can figure out the problem.</p>
  
  <pre><code>// Update is called once per frame
  void Update () {
  
      //directional movement
      if (Input.GetKey (KeyCode.W)) {
          this.transform.Translate(Vector2.up * speed);
          anim.SetBool ("moving", true);
  
      }if (Input.GetKey (KeyCode.A)) {
          this.transform.Translate(Vector2.right * -speed);
          anim.SetBool ("moving", true);
          anim.SetBool ("facingRight", false);
  
      }if (Input.GetKey (KeyCode.S)) {
          this.transform.Translate (Vector2.up * -speed);
          anim.SetBool ("moving", true);
  
      }if (Input.GetKey (KeyCode.D)) {
          this.transform.Translate (Vector2.right * speed);
          anim.SetBool ("moving", true);
          anim.SetBool ("facingRight", true);
  
      } else{
          anim.SetBool ("moving", false);
      }
  }
  </code></pre>