diff --git a/examples/gameplay/moveplayer3D/actors/player.lua b/examples/gameplay/moveplayer3D/actors/player.lua index 6825838..0a33ade 100644 --- a/examples/gameplay/moveplayer3D/actors/player.lua +++ b/examples/gameplay/moveplayer3D/actors/player.lua @@ -36,7 +36,8 @@ function Player:updateEnd(dt) end function Player:setAnimation() - self:setCustomSpeed(math.abs(self.xsp) / 12) + local gsp = utils.math.pointDistance(0, 0, self.xsp, self.ysp) + self:setCustomSpeed(math.abs(gsp) / 12) if (self.isPunching) then self:changeAnimation("punch", false) else