else bug?

This forum is currently in read-only mode.
From the Asset Store
Bug Match
$2.50 USD
50% off
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • I was making some animations and made a condition for it that was:

    if(play_death_animation == true)
             play appropriate death animation
    		moving animation
    		jumping animation
    		falling animation
    However, nothing in that else was being done (and adding a simple event to the top of it didn't affect anything either. I had to invert the original if and then stick the nested ones inside of it to make it work and I thought that was mighty strange and made little sense. Explanation for it?
  • When an else event has subevents it will not function, it is a know bug and is on the bug tracker.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can often avoid using sub-events with just several else statements in line, each grouped with another condition. Works just like if-elif-else conditionals, and has worked fine for me in Construct. Something like this should work:

    + if(play_death_animation == true)
    -> play appropriate death animation
    + else
    + if walking
    -> walking animation
    + else
    + if jumping
    -> jumping animation
    + else
    + if falling
    -> falling animation
    + else
    -> idle animation[/code:2jd4j6v1]
  • After much debugging I worked out what causes the else condition to bugger up when its nesting. It should be fixed for the next version

  • Very cool!

  • Great to hear, David! That will make a big difference to many users, I'm sure.

  • Thank you so much David!

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