title: Coding in a simple dash/slide mechanic C# Unity2d
body: <p>I'm trying to achieve a simple dash akin to Megaman or more recently Hollow Knight where the user inputs a button and they are pushed forward and are unable to cancel. </p>
  
  <p>I have something simple working right now but it simply teleports the player where I'm looking for a fluid motion forward. I've tried youtube tutorials and multiple searches online but I can't seem to find anything that works.</p>
  
  <p>This is my code thus far</p>
  
  <pre><code>if (Input.GetKeyDown (KeyCode.G) &amp;&amp; isSliding == false) {
              slideCount += Time.deltaTime;
              isSliding = true;
              if (slideCount &lt; maxSlideCount) {
                  rb2d.AddRelativeForce (Vector2.right * 100f);
              } 
      else
                  slideCount = 0;
                  isSliding = false;
              }
  </code></pre>