How do check animation by number?

  • Hey there! Thanks for taking your time!

    Basically i have a sprite with all Animations with the same name, just ending with different numbers, such as 0,1,2 etc.

    Now in event i did ''if Animation is playing Run & random(1,3)"

    But that only = true sometimes. The Animations number go past 3, but i wanna only check if 1-3 in this event. Any way to do that?

  • I don't think the last section explanation and question make much sense, can you rephrase?

  • 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 think the last section explanation and question make much sense, can you rephrase?

    Animation names are Run1, Run2, Run3, Run4 and Run5.

    I want that event 'IF Run & 1 or 2 or 3 is playing then execute X.

    Execute only run 1-3, not the others.

    I thought there is simpler way than making 3 seperate events for

    'if sprite is playing Run animation'

    'if frame = 1'

    - then repeat with frame 2 and then frame 3. I thought it could all be in 1 sentence.

  • If you are planning on applying logic based on each frame of animation then they will be one event but the if frame=1, if frame=2, if frame=3 will be sub events because you need to add your actions to it.

  • Hey there! Thanks for taking your time!

    Basically i have a sprite with all Animations with the same name, just ending with different numbers, such as 0,1,2 etc.

    Now in event i did ''if Animation is playing Run & random(1,3)"

    But that only = true sometimes. The Animations number go past 3, but i wanna only check if 1-3 in this event. Any way to do that?

    This works, but might not be suitable to your game logic?

  • > Hey there! Thanks for taking your time!

    > Basically i have a sprite with all Animations with the same name, just ending with different numbers, such as 0,1,2 etc.

    >

    > Now in event i did ''if Animation is playing Run & random(1,3)"

    >

    > But that only = true sometimes. The Animations number go past 3, but i wanna only check if 1-3 in this event. Any way to do that?

    >

    >

    >

    >

    This works, but might not be suitable to your game logic?

    Hey there! That is right, instead of random 1-3 i want a definitely 1-3, aslong as the number is between 1 and 3.

  • If you are planning on applying logic based on each frame of animation then they will be one event but the if frame=1, if frame=2, if frame=3 will be sub events because you need to add your actions to it.

    Frame 1 and 2 and 3 = same outcome. So instead of random 1-3 i want a definitely 1-3. Get it?

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