so im really new to coding and such but I’ve been able to figure out the basic such as basic movement and etc. But im struggling to make a dash script, the dash script is supposed to move my the player up the screen very fast when I press W and Space. Heres my code, any help would be great.
using System.Collections;
using UnityEngine;
public class Dash : MonoBehaviour
{
public float dashspeed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetAxisRaw(“Horizontal”) > 0.5f && Input.GetKeyDown(“Space”))
{
transform.Translate(new Vector3(Input.GetAxisRaw(“Horizontal”) * dashspeed * Time.deltaTime, 0f, 0f));
}
}
}