Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Change velocity lerp to make it more consistent at varying frame rates
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-makes-code committed Jan 22, 2024
1 parent 013b062 commit 00c5de4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Client/World/Entity/ControlledClientPlayerEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void Update(double delta) {
rotation.x = MathF.PI/2;

movement3d = new dvec2(0, rotation.y).RotationVecToQuat() * movement3d * 4;
var localVel = dvec2.Lerp(velocity.xz, movement3d.xz, 0.9);
var localVel = dvec2.Lerp(velocity.xz, movement3d.xz, 25 * delta);
velocity = velocity.WithXZ(localVel);

if (Keybinds.Jump.isPressed)
Expand Down

0 comments on commit 00c5de4

Please sign in to comment.