浏览代码

Fix invisible character in lua version of example 50

1vanK 6 年之前
父节点
当前提交
5f52f9433f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bin/Data/LuaScripts/50_Urho2DPlatformer.lua

+ 1 - 1
bin/Data/LuaScripts/50_Urho2DPlatformer.lua

@@ -355,7 +355,7 @@ function Character2D:Update(timeStep)
         if self.onSlope then
             body:ApplyForceToCenter(moveDir * MOVE_SPEED / 2, true) -- When climbing a slope, apply force (todo: replace by setting linear velocity to zero when will work)
         else
-            node:Translate(moveDir * timeStep * 1.8)
+            node:Translate(Vector3(moveDir.x, moveDir.y, 0) * timeStep * 1.8)
         end
         if jump then
             body:ApplyLinearImpulse(Vector2(0, 0.17) * MOVE_SPEED, body.massCenter, true)