Strange error in Runtime-Animation-AnimationState.cpp

Hi

I’m doing something very simple. I have an animation. At specific points on the timeline I have added some events.
At these points, I want the animation to pause, then wait for user interaction before continuing either forwards or backwards in the timeline.
Here’s the code to pause:

gameObject.animation[_cameraAnimName].speed=0;

Here’s the code to resume in either direction:

if(horizontalInput>0){
	gameObject.animation[_cameraAnimName].speed=1;		
}else if(horizontalInput<0){
	gameObject.animation[_cameraAnimName].speed=-1;
}

However, I’m getting the following error, almost at random, when the animation stops:

Abs(15.000000 - 14.989902) <= 0.008329
0.010098 <= 0.008329
1.769141e-003 <= 0
Assert in file: ..\..\Runtime\Animation\AnimationState.cpp at line 247

Any ideas why this is? I’m using Unity 3.1.0f4

I have the same problem, only my error says line 250 in the same file… I have absolutely no idea what’s wrong.

Someone with any idea? I’m using unlity 3.3.0f4.

Same problem here. Any solution?

I’m doin exactly as the situation describes… and this is the error…also all the events in my anim get messed up and trigger at the wrong timings…
Abs(14.350000 - 14.420706) <= 0.050494
0.070706 <= 0.050494
2.021127e-002 <= 0

Assert in file…AnimationState.cpp at line 307

Same error. It doesn’t seem to affect how my game plays, but it does slightly slow it down, so it’s annoying, but not game-breaking.

Code:

using UnityEngine;
using System.Collections;

public class FireFlipper1 : MonoBehaviour {
	bool fired;
	public string Command;
	public int speed;
	public string anime;
	//int timeAdjustment;
	// Use this for initialization
	void Start () {
	fired=false;
	//timeAdjustment=0;
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetAxis(Command)>0  !fired)
		{
			animation[anime].speed = speed;
			animation.Play(anime);
			fired=true;
		}
//		if (animation[anime].time>=animation[anime].length)
//			fired=true;
		else if (Input.GetAxis(Command)<=0)
		{
			if (fired  animation[anime].time==0)
				animation[anime].time=animation[anime].length;
			animation[anime].speed = speed*-1;
			animation.Play(anime);
			fired=false;
		}
				//  fired  (animation[anime].time==0 || 
		    //                                       animation[anime].time==animation[anime].length+timeAdjustment))
	}
}

We’re getting the same error here when playing with the animation speeds. Anyone has any update on this one?

This post is 7 years old (edit: 9 years, actually) but the bug still occures in 2018.4.0f1 and this is the top google result.

To reproduce the bug, you have to create an animation with wrap mode loop and with an event at 0:00 that calls a method in which the animation speed is set to zero.

My workaround was changing the animation event to trigger at 0:01 ms.