I’m trying to make a dash ability that dashes in the direction of the mouse or in the direction that the controller knob is being held. I set up the input, and set the action type to value with control type as Vector2, I also set up the logic for how my dash will work. The logic should work fine, but I don’t actually know how to get the Vector2 from the input to use in the dash. Here’s the code, if you can help me that would be awesome. Thanks!
public void Dash(InputAction.CallbackContext context)
{
//dash when dash button is pressed
if (context.performed && canDash == true)
{
//stuff here to actually dash
canDash = false;
StartCoroutine(DashTime());
}
}
public void DashAim(???)
{
//get vector2 from input (if that's how it works)
}
IEnumerator DashTime()
{
yield return new WaitForSeconds(3f);
canDash = true;
}
}