[UPDATE] use set_yaw_by_direction

This commit is contained in:
tacigar 2016-09-18 08:54:52 +09:00
parent 008ead10f4
commit 68d4f6dbae
2 changed files with 1 additions and 2 deletions

View File

@ -388,7 +388,6 @@ function maidroid.register_maidroid(product_name, def)
collisionbox = {-0.25, -0.5, -0.25, 0.25, 1.05, 0.25},
is_visible = true,
makes_footstep_sound = true,
automatic_face_movement_dir = 90.0,
infotext = "",
nametag = "",

View File

@ -6,7 +6,6 @@
local state = {IDLE = 0, ACCOMPANY = 1}
local function on_start(self)
print("KOKO")
self.state = state.IDLE
self.object:setacceleration{x = 0, y = -10, z = 0}
self.object:setvelocity{x = 0, y = 0, z = 0}
@ -46,6 +45,7 @@ local function on_step(self, dtime)
end
self.object:setvelocity{x = direction.x, y = velocity.y, z = direction.z} -- TODO
end
self:set_yaw_by_direction(direction)
-- if maidroid is stoped by obstacle, the maidroid must jump.
if velocity.y == 0 and self.state == state.ACCOMPANY then