0 Favourites

How do I PICK RANDOM ANIMATION?

  • I created a SPRITE. In it I have different ANIMATIONS: Animation1, Animation2, - different frames - etc.

    I would like to:

    Bullet OnCollision with SPRITE > Play Animations (contained in ITEM) Randomly.

    I don't know if that's clear but the fact of the matter is: I already have this going like SET ANIMATION TO ("Animation1, Animation2, Animation3")

    I tried quoting animations individually and all but it still aint working.

    HELP

  • I created a SPRITE. In it I have different ANIMATIONS: Animation1, Animation2, - different frames - etc.

    I would like to:

    Bullet OnCollision with SPRITE > Play Animations (contained in ITEM) Randomly.

    I don't know if that's clear but the fact of the matter is: I already have this going like SET ANIMATION TO ("Animation1, Animation2, Animation3")

    I tried quoting animations individually and all but it still aint working.

    HELP

    Use the choose() function.

    choose("Animation1", "Animation2", "Animation3")

  • > I created a SPRITE. In it I have different ANIMATIONS: Animation1, Animation2, - different frames - etc.

    >

    > I would like to:

    >

    > Bullet OnCollision with SPRITE > Play Animations (contained in ITEM) Randomly.

    >

    > I don't know if that's clear but the fact of the matter is: I already have this going like SET ANIMATION TO ("Animation1, Animation2, Animation3")

    >

    > I tried quoting animations individually and all but it still aint working.

    >

    > HELP

    >

    Use the choose() function.

    choose("Animation1", "Animation2", "Animation3")

    Is this the simpliest way?

  • kiko2015 What I would do is have a variable for the random animation then in the event sheet have each animation set to a number on a viable then you just change the variable to a random number.

  • try

    Sprite set animation

    "Animation"&str(int(random(8))+1)[/code:36umd510]
  • kiko2015 What I would do is have a variable for the random animation then in the event sheet have each animation set to a number on a viable then you just change the variable to a random number.

    Thank you. Unfortunately, none of the answers helped me. But I ould like to know if we have exchanged emails before. I cant find your email. I would like to help ypu.

  • kiko2015 Sorry for that you are correct the email is wrong here's the right email address .com

  • You could try this , under set animation

    I have used this before, it works.

    tokenat("animation1|animation2|animation3|animation4|animation5|animation6", int(random(6)),"|")

    Of course Anonnymitet has the Easiest method with Choose

  • I don't understand how the above answers could not help you? That is exactly how you do it.

    on bullet collision with player --> set animation to --> choose("animation1","animation2","animation3")

    Remember to add "" around every animation name like the example above.

    So in the text field on the play animation action you write exactly this:

    choose("animation1","animation2","animation3")[/code:y25mhxh8]
    
    Except change the name of the animations to the ones you want to use
  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I don't understand how the above answers could not help you? That is exactly how you do it.

    on bullet collision with player --> set animation to --> choose("animation1","animation2","animation3")

    Remember to add "" around every animation name like the example above.

    So in the text field on the play animation action you write exactly this:

    choose("animation1","animation2","animation3")[/code:1aobmi2u]
    
    Except change the name of the animations to the ones you want to use
    

    Thank you. It DOES work, Myy bad!!!! Thank you so much!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,235
FlyingRam's avatar
FlyingRam
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff
Unread hot topic
0 Favourites
random bugs and suggestions
90 4,516
Tom's avatar
Tom Construct Team Founder