mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-07-18 20:36:41 -04:00
Bug fixes
This commit is contained in:
parent
fc6a203da2
commit
72f55abc2d
3 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue