- Home /
Question by
sinkler747 · Oct 27, 2013 at 02:27 PM ·
animationrandom
I'm wanting to play 2 or 3 randomized animation clips
I have a couple of animations that I want to be randomized when something happens. how can I go about that. I thought that maybe scripting animation.Play(Random("crawl", "standUp"));
I thought that might work, but didn't. any suggestions?
Comment
Answer by cjdev · Oct 27, 2013 at 03:01 PM
You could try something like this:
string[] anims = { "crawl", "standUp" };
animation.Play(anims[Random.Range(0, anims.Length - 1)]);
that didn't work for me. I am using " Js", but i did convert it over > var anims : string[] = {"crawl", > "standUp"};
` but that gave me errors.
Your answer
Follow this Question
Related Questions
Random AudioSource and Animation? 0 Answers
Random animation and InvokeRepeating 1 Answer
Random attack animation 1 Answer
Random Animation of gameObject Children 1 Answer
Random location when clicked on 1 Answer