Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Why is this throwing an "IndexOutOfRangeException: Index was outside the bounds of the array." error

$
0
0
I am getting a error on the line "playingAnimation = animInfo[0].clip.name;" but everything seems to be working fine. Any idea on how to stop the error from showing, or if I am doing something wrong. Code: void Update() { animInfo = animator.GetCurrentAnimatorClipInfo(0); playingAnimation = animInfo[0].clip.name; AnimationSet(); animator.CrossFade(targetAnimation, transitionTime, 0); } void AnimationSet() { transitionTime = 0.05f; targetAnimation = "Idle"; if(state.isMoving) { transitionTime = 0.1f; targetAnimation = "Walking"; if(state.isRunning) targetAnimation = "Running"; } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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