[Fixed] Pick Nearest from certain sprites

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.
  • Hi all

    I have set of events and they're not working like I think they should.

    FamilySprite Is overlapping "DeadZone"

    FamilySprite Health = 0

       FamilySprite Pick nearest to Player.x, Player.Y

    Here I expect it to only pick the nearest dead enemy in the deadzone, but instead it's picking from all the enemies on screen.

    I thought conditions filtered things but that doesn't seem to happen here?

  • That should work, can you post an .capx of the problem?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The first two conditions aren't set as seperate events are they? If they are, it'll reset the pick after the first one. The 2nd pick either needs to be indented or part of the same event as the first.

    Sorry if that's not the issue but I tend to make really basic errors like this all the time in C2 and get held up for hours trying to work out what's going on <img src="smileys/smiley36.gif" border="0" align="middle" />

  • I've tried it exactly as above - two conditions in one event and then the pick nearest as a sub, I've also tried all three conditions in one event in the same order.. in all cases it's picking enemies that don't meet the first two criteria. I'll try knock up an example (not ready to share this game with the world yet, hehe).

  • OK ignore me, it does work, total red herring hiding the real issue.

    Sorry 'bout that! <img src="smileys/smiley11.gif" border="0" align="middle" />

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