How do I add Multiple PICK conditions?

0 favourites
  • 7 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Let's say I want to Pick sprites that have four different animations names, pick all the instances that happens have one of these following names:





    how would I do it best way?

    I tried first

    Pick Sprite where Sprite.AnimationName = "Play"


    Pick Sprite where Sprite.AnimationName = "Hello"


    Pick Sprite where Sprite.AnimationName = "Flower"


    Pick Sprite where Sprite.AnimationName = "Rabbit"


    For each Sprite order by 0 Ascending

    more sub events.....

    Then I removed the "or"..

    but neither seems to work so maybe this is bad logic?

  • Pick by comparison:

    Object: Sprite

    Expression: Sprite.AnimationName="Play" | Sprite.AnimationName="Hello" | Sprite.AnimationName="Flower" | Sprite.AnimationName="Rabbit"

    Comparison: Equal to

    Value : 1

  • blackhornet to the rescue again!

    (and I have vague memory that we did same thing earlier.. )

  • Too soon. It seems I ran the wrong capx when testing.

    Did not work.

    I wrote like this:


    and it did not pick any of them.

  • Look closer at my example. You aren't doing the same thing.

  • Oh yes. Forgot the animation name.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It did not work initially, but when I did an experiment I understood I had to create variables first! Because it did not understand (variable1 & "blabla") | (variable2 & "this"), fed it with local string varibles. THEN it worked!

    blackhornet Sorry for being daft.

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