I have a butterfly animation 1 is orange butterfly flying animation 2 is yellow butterfly flying animation three is purple butterfly flying animation I want to do this Event(On start of the layout) Action(Pick random animation) How do I do it?
Choose("Animation1","Animation2","Animation3","Animation4","Animation5","Animation6","Animation7","Animation8","Animation9","Animation10","Animation11")
Develop games in your browser. Powerful, performant & highly capable.
Choose works very well.
You can also do it by randomizing a variable and depending on the variable value play an animation.
Ie. butterflyVAR=random(0,10) (number of animations) then set each animation to a number butterflyVAR=1 play animation1, etc.
You could use an arrays if you had lots of butterflies.
For what your describing choose is probably best.
Another way is to build a string with expressions:
Animation to play: "animationName"&int(random(1,200))
substitute the 200 with the total amount of animations.
jojoe — I can't find choose?
You can find more on choose here :
https://www.scirra.com/manual/126/system-expressions
Rather than putting the animation name in the play animation action you would use one of the Choose or random expressions.
Hope that helps.
You will find that unlike many software manuals, Construct2's manual is your friend. It is very comprehensive!