Give numerical range in "Is animation playing" condition?

0 favourites
  • 3 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • I have a sprite with several animations that share part of a name; "Anim1", "Anim2", "Anim3". Some conditions tell the sprite to play "Anim"&choose(1,2,3) to randomize the animation played.

    Is there a way to do that in reverse, i.e. check "If animation "Anim"&(1 or 2 or 3) is playing"? Or is an OR block the way to do it?

    I've done a similar thing with animations that are dependent on the object's angle, but it's not quite the same.

  • Use "System Compare Two Values" condition. left(Character.AnimationName,4)="Anim"

    Be aware, that this condition doesn't pick instances, if you have many character instances, then use "System Pick By Evaluate" instead.


    If there are many "AnimN" animations and you want to check if only animation 1, 2 or 3 is playing, then you can use this expression:

    left(Character.AnimationName,4)="Anim" & int(mid(Character.AnimationName,4,1))<4

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oops forgot to check back here.

    Thanks, I'll try those.

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