pick nth instance OR only instance

0 favourites
  • 5 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.
  • When I touch a object, I want to either

    1. pick the 1st instance, if there are multiple ones where I touch OR

    2. pick the only instance, if there are NOT multiple instances where I touch.

    I then do some actions to that particular instance.

    To do this I use "pick instance 1", however if I just touch one instace, it doesnt pick any. If I don't use "pick instance 1" then I cant pick one instance from multiple ones I touch.

    If I use else, I then have to repeat the action or introduce a function. Is there a way to do this more efficiently?

    Am I missing something?

    Tagged:

  • when you touch it already does the Pick on that object.

    OnTouch Object - picks only the object touched.

    Else doesn't really make sense here.

  • If instances overlap, then I believe "On touched object" can pick multiple instances. Simply add another condition, for example "Pick top instance" to the event.

    If you want to pick the first instance of multitple by index, use "Pick Nth instance" with instance=0 (not 1).

  • Yes, that was it. Should be 0 not 1.thx dop2000

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • strange I would only think it would default to picking the top one, but I guess that makes sense that its more about coordinates rather than Z order.

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