- Home /
Error in AnimationState.cpp Line: 307
Hello, there!
I'm getting a weird runtime error in my project:
Abs(1.166667 - 1.186842) <= 0.015343 0.020175 <= 0.015343 4.831929e-03 <= 0
(Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Animation/AnimationState.cpp Line: 307)
Any ideas what could be causing that?
By the filename, it is probably something related to animations. I use a bunch of animated characters prefabs, most of them uses animation events. It is strange that the project is in development for about 4 months and that error just shown up this week. Nothing was changed in the way we work with animations and events.
That is causing the game to crash on mobile devices. =(
Using Unity 3.4.0f5
Answer by Alavan · Feb 02, 2012 at 03:26 AM
I'm getting the same error. Here is my 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))
}
}