- Home /
Strange error with animation: "Time is out of range"
Hello, the thing is I have a character controller script that works with Rigidbodys, once I had it completely coded, I wanted to add animations. I started with the "Run" and "Jump" animation... So this is what I have in that part of the code:
if (CanJump && Input.GetButton("Jump")) {
rigidbody.velocity = new Vector3(rigidbody.velocity.x, CalculateJump(), rigidbody.velocity.z);
animation.CrossFade("Jump", 0.5f);
} else {
animation.CrossFade("Run", 0.5f);
}
The thing is, When I pess space (Jump) the character makes the Jump Animation, but when it is in the last frame (Or almost the last one, I dont know) I get this error:
Time is out of range: 1.346396 < 1.333333
The first value given is always random... Does anybody know why this happens? It stops My entire game, and I cant keep playing.
From code point of view it's ok. Please look at animation (fbx) file if it doesn't have any errors or if it have been properly imported into Unity.
Apparently it is correctly imported, it doesnt show any errors, how can I know if it is good or not?
Oh, I forgot to tell you, the code is in a FixedUpdate, If I change it to Update ins$$anonymous$$d, the animation works for 3 or 4 times, then it throws the same error, I dont know what else to do.
Does somebody knows how to solve the problem? Im going mad!!! I cant find the solution and In google nothing shows up!
Your answer
Follow this Question
Related Questions
IndexOutOfRangeException 1 Answer
AnimationEvent has no receiver, but there is no AnimationEvent 1 Answer
Fast-forwarding an animation to its last frame 2 Answers
Gun script help 1 Answer
install Animation Riggit 0 Answers