This commit is contained in:
CortexCore
2024-03-25 16:08:26 +08:00
parent 65d90d1bfa
commit 967ad8eacf
67 changed files with 3097 additions and 39530 deletions

View File

@@ -138,10 +138,10 @@ namespace BITFALL.Entities.Player.Movement.States
{
actor.ForceNotGrounded();
if (characterController.landFreeze.AllowUpdateWithoutReset is false)
{
currentVelocity = Vector3.Lerp(currentVelocity, default, 0.8f);
}
// if (characterController.landFreeze.AllowUpdateWithoutReset is false)
// {
// currentVelocity = Vector3.Lerp(currentVelocity, default, 0.8f);
// }
currentVelocity.y+= initialJumpForce;
@@ -190,11 +190,18 @@ namespace BITFALL.Entities.Player.Movement.States
// Apply added velocity
currentVelocity += addedVelocity;
}
else
{
var tempVelocity = currentVelocity;
tempVelocity = Vector3.Lerp(tempVelocity, default, 2*deltaTime);
currentVelocity.x = tempVelocity.x;
currentVelocity.z = tempVelocity.z;
}
// Gravity
currentVelocity += -Vector3.up * (30 * deltaTime);
// Drag
currentVelocity *= (1f / (1f + (0.1f * deltaTime)));
currentVelocity *= (1f / (1f + 0.1f * deltaTime));
}
}