Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Strange error with animation: "Time is out of range"

$
0
0
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.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>