mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
fix acceleration when laging
This commit is contained in:
parent
1bd63a4eb0
commit
5d5ad0d240
1 changed files with 2 additions and 1 deletions
|
@ -498,8 +498,9 @@ function airutils.logic(self)
|
|||
self._last_accell = new_accel
|
||||
self.object:move_to(curr_pos)
|
||||
--airutils.set_acceleration(self.object, new_accel)
|
||||
local limit = 100
|
||||
local limit = (self._max_speed/self.dtime) * 2
|
||||
local vel_to_add = vector.multiply(new_accel,self.dtime)
|
||||
if new_accel.y > limit then new_accel.y = limit end --it isn't a rocket :/
|
||||
vel_to_add.y = 0
|
||||
self.object:add_velocity(vel_to_add)
|
||||
self.object:set_acceleration({x=0,y=new_accel.y, z=0})
|
||||
|
|
Loading…
Add table
Reference in a new issue