From 3f12d89a8db734bbee234030d2954d99d9369d07 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Wed, 11 Oct 2023 19:51:55 -0300 Subject: [PATCH] changed custom physics to use add_velocity instead of set_velocity --- lib_planes/custom_physics.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_planes/custom_physics.lua b/lib_planes/custom_physics.lua index fba2bb3..a394f54 100755 --- a/lib_planes/custom_physics.lua +++ b/lib_planes/custom_physics.lua @@ -51,6 +51,7 @@ function airutils.physics(self) new_velocity = {x=new_velocity.x*friction, y=new_velocity.y, z=new_velocity.z*friction} + -- bounciness if self.springiness and self.springiness > 0 and self.buoyancy >= 1 then local vnew = vector.new(new_velocity) @@ -82,7 +83,10 @@ function airutils.physics(self) end --damage the plane if it have hard friction end - self.object:set_velocity(new_velocity) + --self.object:set_velocity(new_velocity) + local vel_sum = vector.subtract(new_velocity,vel) + self.object:add_velocity(vel_sum) + end end