Check If There Are Things In Front Of An Object Before Doing An Action.

Discussion in 'How Can I...?' started by roaring_sky_sharks, Jan 11, 2020.

  1. roaring_sky_sharks

    roaring_sky_sharks Boxer

    Joined:
    Feb 18, 2016
    Messages:
    4
    Likes Received:
    3
    I'd like to be able to only do certain actions on objects that don't have anything in front of them (the objects overlap each other). Not the front-most object, but simply ones what have nothing in front of them. I'm not sure how to check for that.

    So, for example, all objects might get a highlight glow when they are tapped/clicked (and/or animate slightly larger until the tap/click is released), but only those that have nothing in front of them would also do another action (specifically, add to the score and disappear), thus potentially allowing other objects to now have nothing in front of them.

    I would prefer for the objects to check dynamically, rather than programmatically set what "order" the objects are in, as gravity is involved, and they may move during play.

    Thanks.

    PS I'm assuming I should be using objects rather than characters. It's a tapping puzzle game.
     

Share This Page