Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
UnidayStudio committed Nov 8, 2018
1 parent 541b36d commit 7348077
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/SimpleAnimator.py
Expand Up @@ -90,7 +90,7 @@ def __handleGroundAnimations(self):

# TO DO: Interpolate between these animations according to the speed.
speed = self.__moveDirection.length
if speed <= 0.001:
if speed <= 0.003:
self.__animate(self.__animIdle)
elif speed <= self.maxWalkSpeed+0.001:
self.__animate(self.__animWalk)
Expand Down Expand Up @@ -118,8 +118,11 @@ def alignToMoveDirection(self):
# direction. If so, applies a small rotation just to avoid a weird
# delay that alignAxisToVect has in this case.
vec = self.object.worldOrientation * Vector([0,1,0])
if vec.angle(self.__moveDirection) >= pi-0.01:
self.object.applyRotation([0,0,0.01], False)
try:
if vec.angle(self.__moveDirection) >= pi-0.01:
self.object.applyRotation([0,0,0.01], False)
except:
pass

length = clamp(length*20, 0, 1) * self.alignSmooth
self.object.alignAxisToVect(self.__moveDirection, 1, length)
Expand Down

0 comments on commit 7348077

Please sign in to comment.