diff --git a/Assets/Scripts/Infinitra/Movement/Movement.cs b/Assets/Scripts/Infinitra/Movement/Movement.cs index 9f4f017..30b5c3f 100644 --- a/Assets/Scripts/Infinitra/Movement/Movement.cs +++ b/Assets/Scripts/Infinitra/Movement/Movement.cs @@ -43,7 +43,9 @@ public class Movement : MonoBehaviour, IMovement private float crouchTimeElapsed; private float crouchHeightStart; - + + private float bounceThreshold; + public void Awake() { xrOrigin = GetComponent(); @@ -118,7 +120,7 @@ private void processMove(float deltaTime) if (goUserXr.collDown) { // Bouncing off ground. - if (velocity.y < 0.0) velocity.y = -velocity.y * 0.25f; + if (velocity.y < bounceThreshold) velocity.y = -(velocity.y-bounceThreshold) * 0.25f; } else { @@ -149,7 +151,7 @@ private void processMove(float deltaTime) Vector normalComponent = velocity - parallelComponent; frictionVector = -normalComponent * deltaTime * modelConfig.friction * frictionFactor; - } + } else { frictionVector = -velocity * deltaTime * modelConfig.friction * frictionFactor; @@ -390,6 +392,7 @@ public void applyModelConfig(IModelConfig config) charaController.slopeLimit = config.charSlope; charaController.minMoveDistance = config.charMoveDist; charaController.enableOverlapRecovery = true; + bounceThreshold = config.bounceThreshold; } } } \ No newline at end of file