added upwards force modifier

This commit is contained in:
Richard Ott
2018-09-01 21:36:14 +02:00
parent 66074815c3
commit da213d5e41

View File

@@ -24,7 +24,9 @@ public class LurchMovement : MonoBehaviour {
[Header("Jump Charge")] [Header("Jump Charge")]
public float maxJumpForce; public float maxJumpForce;
public float upForceModifier = 2.0f;
private float currentJumpForce; private float currentJumpForce;
private float currentJumpForwardForce;
public float forceIncreaseSpeed; public float forceIncreaseSpeed;
public Color normalColor; public Color normalColor;
@@ -142,7 +144,7 @@ public class LurchMovement : MonoBehaviour {
lurchBody.isKinematic = false; lurchBody.isKinematic = false;
lurchBody.AddForce(theLurch.forward * currentJumpForce, ForceMode.Impulse); lurchBody.AddForce(theLurch.forward * currentJumpForce, ForceMode.Impulse);
lurchBody.AddForce(theLurch.up * currentJumpForce, ForceMode.Impulse); lurchBody.AddForce(theLurch.up * currentJumpForce * upForceModifier, ForceMode.Impulse);
} }
else if (LurchOnGround() && Time.time > cooldown) else if (LurchOnGround() && Time.time > cooldown)
{ {