Question by
shahzaib · Aug 02, 2016 at 04:06 PM ·
arraysanimations
how to change speed of animations in an array?
I'm trying to put animations in a public array through inspector and then changing speed of every animation in that array in runtime through a public float variable but for some reasons it's not working. Below is my code:
public Animation[] anim;
[Range(0,2)]
public float AnimationSpeed;
public static bool aboard;
// Update is called once per frame
void Update ()
{
foreach (Animation an in anim)
{
anim [anim.Length] [an].speed = AnimationSpeed;
}
}
Would be really thankful if somebody could guide me on this issue.
Thanks!
Comment
Your answer
Follow this Question
Related Questions
animation array trying to play all at once 0 Answers
Help with non stop looping animation!! 1 Answer
Connect two or more objects 1 Answer
Strange behavior with animation 1 Answer
How To Fix GameObject Disappearing when Animator is active? 0 Answers