fix(moveplayer3D): use ground speed instead of xsp for animations

This commit is contained in:
Kazhnuz 2019-07-01 10:50:21 +02:00
parent cf04a16c84
commit ddebdba2e8

View file

@ -36,7 +36,8 @@ function Player:updateEnd(dt)
end end
function Player:setAnimation() 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 if (self.isPunching) then
self:changeAnimation("punch", false) self:changeAnimation("punch", false)
else else