This commit is contained in:
allylikesfrogs 2023-05-03 09:53:26 -07:00
parent e134dc039e
commit e0308905a3
2 changed files with 15 additions and 3 deletions

View File

@ -5,6 +5,7 @@ using UnityEngine.InputSystem;
public class PlayerBehavior : MonoBehaviour
{
public PlayerData Data;
[Header("Physics:")]
private float _hInput;
@ -105,7 +106,17 @@ public class PlayerBehavior : MonoBehaviour
}
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime))
{
Vector3 dashSpeed = new Vector3(1f,1f,1f) * dashMult;
//float speed = dashMult * Data.runMaxSpeed;
Vector2 dashSpeed;
if(forward == 1)
{
dashSpeed = new Vector2(1,-1) * dashMult;
}
else
{
dashSpeed = new Vector2(-1,-1) * dashMult;
}
_rb.AddForce(dashSpeed, ForceMode2D.Force);
currentDashTime += dashStopSpeed;

View File

@ -332,10 +332,11 @@ public class PlayerMovement : MonoBehaviour
if (trumpet == 0) {
gameUI.ToggleTrumpet(false);
}
if (isDashing)
/*if (isDashing)
{
gameUI.ToggleClarinet(false);
}
print("toggle clarinet false?");
}*/
#endregion
}
}