title: Stuttering movement in Unity 2D
body: <p>So basically I am trying to make player movement system like one in RPG Maker with 8 directions. Somehow I succeded, but only partially. When I am trying to suddenly change direction for ex. from up to left, character stutter and do not want to move without releasing all keys first.</p>
  
  <p>Gravity scale is disabled or more like set to 0, body type is dynamic.</p>
  
  <p>Here is a code:</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class MoveChar : MonoBehaviour {
  
  Rigidbody2D rigid;
  
  public float Speed;
  
  // Use this for initialization
  void Start () {
  
      rigid = GetComponent&lt;Rigidbody2D&gt;();
  
  }
  
  // Update is called once per frame
  void Update () {
  
  //        float horiz = Input.GetAxis("Horizontal");
  
  //        float vert = Input.GetAxis("Vertical");
  
      if(Input.GetKeyDown(KeyCode.W)) //________________________________________MOVING UP
  
      {
          rigid.velocity = new Vector2(rigid.velocity.x, 1 * Speed);
      }
      else if(Input.GetKeyUp(KeyCode.W))
      {
          rigid.velocity = new Vector2(0, 0);
      }
  
      if (Input.GetKeyDown(KeyCode.S)) //_______________________________________MOVING DOWN
      {
          rigid.velocity = new Vector2(rigid.velocity.x, -1 * Speed);
      }
      else if (Input.GetKeyUp(KeyCode.S))
      {
          rigid.velocity = new Vector2(0, 0);
      }
  
  
      if (Input.GetKeyDown(KeyCode.A)) //_______________________________________MOVING LEFT
      {
          rigid.velocity = new Vector2(-1 * Speed, rigid.velocity.y);
      }
      else if (Input.GetKeyUp(KeyCode.A))
      {
          rigid.velocity = new Vector2(0, 0);
      }
  
      if (Input.GetKeyDown(KeyCode.D)) //_______________________________________MOVING RIGHT
      {
          rigid.velocity = new Vector2(1 * Speed, rigid.velocity.y);
      }
      else if (Input.GetKeyUp(KeyCode.D))
      {
          rigid.velocity = new Vector2(0, 0);
      }
  }
  </code></pre>