diff --git a/engine/src/core/com/jme3/animation/AudioTrack.java b/engine/src/core/com/jme3/animation/AudioTrack.java index 14d8d64f2..1440af160 100644 --- a/engine/src/core/com/jme3/animation/AudioTrack.java +++ b/engine/src/core/com/jme3/animation/AudioTrack.java @@ -68,6 +68,7 @@ public class AudioTrack implements ClonableTrack { private float length = 0; private boolean initialized = false; private boolean started = false; + private boolean played = false; //Animation listener to stop the sound when the animation ends or is changed private class OnEndListener implements AnimEventListener { @@ -121,7 +122,7 @@ public class AudioTrack implements ClonableTrack { */ public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { - if (time == length) { + if (time >= length) { return; } if (!initialized) { diff --git a/engine/src/core/com/jme3/animation/EffectTrack.java b/engine/src/core/com/jme3/animation/EffectTrack.java index fe79bf1bf..9d6b9b4d2 100644 --- a/engine/src/core/com/jme3/animation/EffectTrack.java +++ b/engine/src/core/com/jme3/animation/EffectTrack.java @@ -192,7 +192,7 @@ public class EffectTrack implements ClonableTrack { */ public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { - if (time == length) { + if (time >= length) { return; } //first time adding the Animation listener to stop the track at the end of the animation