diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 3e6d19f430..46c1c9a4c7 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -267,9 +267,9 @@ void ModelEntityItem::updateFrameCount() { if (!getAnimationHold() && getAnimationIsPlaying()) { float deltaTime = (float)interval / (float)USECS_PER_SECOND; _currentFrame += (deltaTime * getAnimationFPS()); - if (_currentFrame > getAnimationLastFrame()) { - if (getAnimationLoop()) { - _currentFrame = getAnimationFirstFrame() + (int)(glm::floor(_currentFrame - getAnimationFirstFrame())) % (updatedFrameCount - 1); + if (_currentFrame > getAnimationLastFrame() + 1) { + if (getAnimationLoop() && getAnimationFirstFrame() != getAnimationLastFrame()) { + _currentFrame = getAnimationFirstFrame() + (int)(_currentFrame - getAnimationFirstFrame()) % updatedFrameCount; } else { _currentFrame = getAnimationLastFrame(); }