How do I set random animation?

  • There is an object in me project that has 2 animations. And it creates every x seconds with animation 1(default). But I need this object was created with random (1 or 2) animation. Is it possible to set random animation on creation of an object?

  • There is an object in me project that has 2 animations. And it creates every x seconds with animation 1(default). But I need this object was created with random (1 or 2) animation. Is it possible to set random animation on creation of an object?

    Yes it is possible to set a random animation on object creation.

    *Every X Seconds

    --->Create "Sprite1" at (X,Y)

    --->Set Sprite.AnimationName to choose("Animation1", "Animation2")

    --------------------------------------------------------------------------------------------------------

    I used the expression "choose", it will choose the animation written inside the parenthesis.

  • --->Set Sprite.AnimationName to choose("Animation1", "Animation2")

    I think I'm an idiot becouse I can't understand what I should write:

    System - Every X seconds ->

    System - Create Sprite1 at (x,y)

    Sprite1 - Set animation (HERE)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • like this:

    In this example you spawn a Sprite every 2 seconds randomly between x=840 and y=480 with one of the animation: animation1 or animation2 from Sprite.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)