Deciding animations with expressions?

0 favourites
  • 4 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hi, I'm new to construct, and I'm wondering if it's possible to use variables to easily make construct decide which animation will play off?

    Say for instance that a character has 10 different animations in a sort of combo-tree. Also, let's add to the equation that there's 12 different "variations" of this combo (In total 120 animations).

    Is it possible to for instance name the first animation of the first combo "LeftPunch_1_1", the second "LeftPunch_2_1", the third "LeftPunch_3_1" etc. and have a single expression or equation decide which animation plays off from a single event-line? If this is possible, how would you apply it?

    I imagine it would look something like this:

    "LeftPunch_x(Combo-hits variable)_y(Variation variable)"

    Hope what I described made any sense. :)


  • like set animation "leftpunch_x"&variablex"_y"&variabley ?

  • Tinimations

    haifisch is almost correct...he's missing an "&"

    Player -> set animation "leftpunch_x" & VariableX & "_y" & VariableY

    You can concatenate strings and use variables to piece together the name of the animation you wish to set.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for the quick answer! :)

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