From fb375e352ba61ec2e6e7f4e47c4cae93278d2b1b Mon Sep 17 00:00:00 2001 From: lustlion Date: Tue, 15 Feb 2022 10:55:56 +0100 Subject: [PATCH] air friction for vertical velocity --- code/entities/player.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/entities/player.lua b/code/entities/player.lua index 4cab434..383a7dd 100644 --- a/code/entities/player.lua +++ b/code/entities/player.lua @@ -163,6 +163,9 @@ function Player:DoPhysics() else self.vel.x = self.vel.x * (1-self.airFriction) end + + self.vel.y = self.vel.y * (1-self.airFriction) + if math.abs(self.vel.x) < self.zeroSpeed then self.vel.x = 0 end end