Picking instance in a family that is being dragged/dropped

0 favourites
  • 12 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Dear all,

    I have a family called Tiles with different objects and their instances. I am struggling a lot with being able to figure out which condition I need and the corresponding expression (how, what to fill in) to be able to pick only the instance of an object inside a family that is being dragged/dropped.

    If I do the following, of course all instances in the family move along:

  • I don't really know photon but the picking seems fine, maybe it's just not true for any instance. You can debug it by doing simpler actions and checking in the debug preview to see if the variables are matching with the position of the object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No idea really...

    I forgot to mention that the variables rl1x and rl1y are the staring coordinates of the touch (I also tried the end coordinates of the touch)

  • Ok so the touched objects x,y co-ordinates are unlikely to be the touch x,y. You can check for these values yourself and decide.

  • Thanks for the reply. Well they should be, because I amstoring the x,y values of touch start/end in these global varables.

  • Touch x,y is where the cursor touches the screen, the x,y of tiles is its position on screen, they won't be the same unless you touched exactly at the x,y position of the tile when you started the drag/drop which is unlikely.

  • Aha that's interesting. I am dragging/dropping the tile itself, so isn't it exactly the same then when you touch the instance itself. Am I missing a logical technical detail here? If so, then how should the picking be notated?

    Thank you in advance

  • Depends what you want to do. You can select family > is dragging condition, that will be the one currently being dragged.

  • I need to be able to tell in the expression which instance needs to be repositioned.

    Right now with "isdragging", it again drags all instances at once and puts them on the same spot.

  • Probably an issue with that photon event you are using, I don't know about that.

  • Is there any expression syntax where you can choose the X/Y of an instance of a family with a certain UID?

  • Family > pick by UID, then you can pull data from that instance

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