How do I click an object thats overlapping someting else that can be clicked ?

0 favourites
  • 6 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • *edit2* simplify the request:

    imp. and gold. both can be picked up on click.

    but if they overlap, it picks up both at the same time.

    any idea on how to choose 1 thing?

    dungeon keeper had a highlight on what was selected.. no idea where to begin, its late.

    any help appreciated. helps me think when i try on it tomorrow. on click im setting a global variable to the clicked objects uid.

    thanks all

  • You could use 'mouse cursor is over object' combined with 'pick nearest to mouse.x,mouse.y' to highlight one of them. Then when user clicks make it so the user always picks up the highlighted one.

  • lionz

    sounds simple enough. ill have to push gold away from imps when they are in the same x,y.

    buuut... can i pick nearest for 2 different objects? i can pick nearest imp, or i can pick nearest gold. hmm.. maybe with compare 2 values and distance. ill give it a go. not sure how it will work with multiple imps.

    i have a selector thats the size of a tile (96x96). i could try and break that up to 5 points, so when you drop something it picks a place in order. fun.

    always run into a problem at the end of coding something.

  • Anything that can be picked up you add to a Family, then you say cursor over family and pick nearest family etc.

  • lionz

    yup, perfect advice. didnt think of that. massive thanks as always

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i have a global variable, that calls the pick up items uid.

    instead of pick nearest, it just sets 1 value on click. worked for overlapping imps. should now work for overlapping familymembers.

    then i can just call the "pick up" conditions on a specific item that uid=GV:uidcheck

    *edit* yup works perfectly. family solved all my problems, legend bro

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