Picking objects in the same family

This forum is currently in read-only mode.
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Heyo, I'm having a little difficulty finding ways to use families in picking objects

    How exactly would i go about it? because what if i want to compare variables from two different objects in the same family?

    if Blue.Value('Value') is greater then Blue.Value('Value')???

    Would that work? I'm not really getting any results

    I need my events to look something like this: (Blue is the family)

    If Blue is overlapping Blue

    Pick Blue with highest ZHeight - bring to front

    As it stands, i don't really see anything happening, nothing's being picked and the sprite order doesn't seem to change, so i tried something similar:

    If Blue is overlapping Blue

    If Blue.Value('ZHeight') > Blue.Value('ZHeight') - bring to front

    But this has the same result, nothing. Am i doing something wrong? is there a better way to go about this? or do families have a hard time picking objects with differing variables?

    please .... halp ..... *cough* *splutter*

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm yeah the problem is that the condition 'A overlaps A' will select all the A's which are overlapping. So say theoretically you have 5 objects and they all overlap each other. 5 Objects get selected. Then you check which one has the highest Z value...it will bring that one to the front...but the rest have no effect. Instead it would be better to chuck a 'for each ordered' under the overlap condition. However, as I believe this is for your z axis thing, it would be better just to do a for each ordered on every single object that is affected by the z axis.

  • Put each object in two families. Example: if blue('value') is greater than red('value'). I've found that this works quite well if you need to compare values between and check for collisions with an object in the same family.

  • Dave: Btw, have you checked my post about instance picking? (I'm sorry for advertising it, but it would be cool to hear if it was useful/implementable idea or not from devs)

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