[SOLVED] How do I 'Pick' nearest where inst. variable = x?

0 favourites
  • 4 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.
  • G'day again guys.

    I've looked and can't find. I want to 'pick nearest object' where that objects instance variable also = "idle".

    This is what I have at the moment and it does pick the nearest, but, as you can see if that nearest doesn't have instance variable 'Status' = "IDLE" then nothing happens.

    What I *want* to do: Pick that nearest instance, if the Status variable isn't "IDLE" pick the next nearest.

    [attachment=0:1wqqoxch][/attachment:1wqqoxch]

    Any ideas?

    Thanks in advance - Humpty

  • Try picking status=idle and then pick nearest after that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're so awesome :* :* :* :*

    I thought about that, but in my head it didn't seem it would work. (I should have tried it instead of deciding it woudn't)

    THANKS :* :*

    [attachment=0:sac1q3ja][/attachment:sac1q3ja]

  • Some things are not entirely intuitive in C2.. I just think try and think through the picking/filtering. (Start with the largest group of instances you want to match, not the smallest). You can also have the above in one event, but that's just an optimization.

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