dash is working better!
This commit is contained in:
@@ -20,12 +20,12 @@ public class PlayerBehavior : MonoBehaviour
|
||||
[Header("Clarinet:")]
|
||||
bool unlockedClarinet;
|
||||
[SerializeField] private float dashMult = 2;
|
||||
[SerializeField] private float maxDashTime = 5.0f;
|
||||
[SerializeField] private float maxDashTime = 2.0f;
|
||||
[SerializeField] private float dashStopSpeed = 0.01f;
|
||||
private float currentDashTime;
|
||||
public bool isDash = false;
|
||||
public Vector2 moveDirection;
|
||||
public float dashDistance = 5;
|
||||
public Vector3 moveDirection;
|
||||
public float dashDistance = 0.1f;
|
||||
|
||||
[Header("Grappling:")]
|
||||
[SerializeField] public Tutorial_GrapplingGun grapplingGun;
|
||||
@@ -104,17 +104,17 @@ public class PlayerBehavior : MonoBehaviour
|
||||
currentDashTime = 0.0f;
|
||||
playerInput.DeactivateInput();
|
||||
}
|
||||
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime))
|
||||
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime) && isDash)
|
||||
{
|
||||
if(forward == 1)
|
||||
{
|
||||
moveDirection = transform.right * dashDistance;
|
||||
moveDirection = new Vector3(1f,-1f,0f) * dashDistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveDirection = -(transform.right) * dashDistance;
|
||||
moveDirection = new Vector3(-1f,-1f,0f) * dashDistance;
|
||||
}
|
||||
//_rb.AddForce(dashSpeed, ForceMode2D.Force);
|
||||
transform.position = transform.position + moveDirection;
|
||||
currentDashTime += dashStopSpeed;
|
||||
print("cdt " + currentDashTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user