Bug fixes

This commit is contained in:
ElCeejo 2022-07-22 16:48:59 -07:00
parent fc6a203da2
commit 72f55abc2d
3 changed files with 3 additions and 4 deletions

View file

@ -166,12 +166,12 @@ local function lerp_rad(a, b, w)
end
function mob:turn_to(tyaw, rate)
self.last_yaw = self.object:get_yaw()
self._tyaw = tyaw
rate = rate or 5
local yaw = self.object:get_yaw()
local step = math.min(self.dtime * rate, abs(diff(yaw, tyaw)) % (pi2))
self.object:set_yaw(lerp_rad(yaw, tyaw, step))
self.last_yaw = self.object:get_yaw()
end
-- Set Gravity (default of -9.8)