I have a crystal with animations labeled Green, Red, Blue, ect. and when the enemy explodes, drop crystals. I set the animation to a calculation Random(5)+1, but the animation always stays at the first animation Green. Please help!
I have a crystal with animations labeled Green, Red, Blue, ect. and when the enemy explodes, drop crystals. I set the animation to a calculation Random(5)+1, but the animation always stays at the first animation Green. Please help!
Try using Random(5)+12. The standard animations (Stopped, Walking, Running, etc) take up the lower values, even if you don't use them, then MMF uses the closest animation it can find (in your case Green)
Thanks! It worked! Now can you explain how the randomization worked?
There are 12 default animations in an object so you have to take the 12 into consideration (hence the 12) The animation number actually starts at 0 though, so your default animations are 0-11
So if you do 12+Random(5) it's going to set the animations randomly from 12-16.
Since Random(5) will pick a random number from 0-4. 12 + 0-4 = 12-16
Oh! That makes sense! Thanks for the feedback!!!
That makes sense! Now it worked.