title: How can I make my "dash" push me forward?
body: <p>I am new to programming and was wondering how I could make my &quot;dash&quot; make me move forward. I watched an online tutorial on how to make a dash work but after trying, the dash would only push me at all if I had written <code>rb.velocity = Vector2.up * dashSpeed;</code>. Currently, when I press the dash key, my character's gravity slows down for a second but no movement is made. Can I please get some help in making it push my character?</p>
  <p>If you need clarification, please ask!</p>
  <p>PS: Sorry for the long script, all my player control is in here.</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using System.Security.Cryptography;
  using UnityEngine;
  
  public class CharacterController : MonoBehaviour
  {
      //Player Movement
      public float speed;
      public float jumpForce;
      public Transform feetPos;
      public float checkRadius;
      public LayerMask whatIsGround;
      public float dashSpeed;
      public float startDashTime;
  
  
      public Animator animator;
  
      private Rigidbody2D rb;
      private float moveInput;
      private bool isGrounded;
      private float jumpTimeCounter;
      public float jumpTime;
      private bool isJumping;
      private float dashTime;
      private int direction;
      void Start()
      {
          animator.GetComponent&lt;Animator&gt;();
          rb = GetComponent&lt;Rigidbody2D&gt;();
          dashTime = startDashTime;
      }
  
  
      void FixedUpdate()
      {
          moveInput = Input.GetAxisRaw(&quot;Horizontal&quot;);
          rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
      }
      void Update()
      {
          // Moving
          isGrounded = Physics2D.OverlapCircle(feetPos.position, checkRadius, whatIsGround);
  
          if (moveInput &gt; 0)
          {
              transform.eulerAngles = new Vector3(0, 0, 0);
              animator.SetBool(&quot;Moving&quot;, true);
  
  
          }
          else if (moveInput &lt; 0)
          {
              transform.eulerAngles = new Vector3(0, 180, 0);
              animator.SetBool(&quot;Moving&quot;, true);
          }
          else
          {
              animator.SetBool(&quot;Moving&quot;, false);
          }
          // Jumping
          if (isGrounded == true &amp;&amp; Input.GetKeyDown(KeyCode.Space))
          {
              animator.SetTrigger(&quot;IsJumping&quot;);
              isJumping = true;
              jumpTimeCounter = jumpTime;
              rb.velocity = Vector2.up * jumpForce;
          }
  
          if (Input.GetKey(KeyCode.Space) &amp;&amp; isJumping == true)
          {
              if (jumpTimeCounter &gt; 0)
              {
        
                  rb.velocity = Vector2.up * jumpForce;
                  jumpTimeCounter -= Time.deltaTime;
              }
              else
              {
                  isJumping = false;
              }
          }
          if (Input.GetKeyUp(KeyCode.Space))
          {
              
  
              isJumping = false;
          }
          if (isGrounded == false)
          {
  
              animator.SetBool(&quot;Grounded&quot;, false);
              
          }
          if (isGrounded == true)
          {
              animator.SetBool(&quot;Grounded&quot;, true);
          }
          // Dashing
  
          if(direction == 0)
          {
              if(Input.GetKeyDown(KeyCode.LeftShift))
              {
                  if ((transform.rotation.eulerAngles.y  == 180))
                      {
                      Dashleft();
                      
                  }
                  else
                  {
                      DashRight();
                  }
                  
              }
          }
          else
          {
              if(dashTime &lt;= 0)
              {
                  direction = 0;
                  dashTime = startDashTime;
                  
              }
              else
              {
                  dashTime -= Time.deltaTime;
  
            
              }
          }
      }
      void Dashleft()
      {
          rb.velocity = Vector2.left * dashSpeed;
      }
      void DashRight()
      {
          rb.velocity = Vector2.right * dashSpeed;
      }
  }
  </code></pre>