How do I PICK RANDOM ANIMATION?

0 favourites
  • 10 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • 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
  • Try Construct 3

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

    Try 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)