- Code: Select all
function onUpdate()
if (input.keyDown("i")==1) then
entity.move (obj, 0, 0, -0.006)
anim.playAnimation (obj, "walk", 30, 1)
elseif (input.keyDown("j")==1) then
entity.turn(obj, 0, 1, 0)
else
anim.playAnimation (obj, "idle", 30, 1)
end
end
I expect that if you rotate the character entity.turn(), then it will move in the direction of rotation:
but he is not moving depends on the direction of the model:
it is not very convenient...