using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Dash : MonoBehaviour
{
public float hoverPower = 300;
const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded
private bool m_Grounded; // Whether or not the player is grounded.
private Rigidbody2D m_Rigidbody2D;
private bool m_FacingRight = true; // For determining which way the player is currently facing.
private Vector3 velocity = Vector3.zero;
// Start is called before the first frame update
void Start()
{
if (!(m_FacingRight = true))
{
if (Input.GetButtonDown("Dash"))
{
GetComponent<Rigidbody2D>().AddForce(Vector2.right * hoverPower);
}
else if (!(m_FacingRight = false))
{
Input.GetButtonDown("Dash");
{
GetComponent<Rigidbody2D>().AddForce(Vector2.left * hoverPower);
}
}
}
}
}