0 Favourites

Dragging objects and collision polygon [SOLVED]

  • Hi

    I am sure I have found this before here and have searched here and on the net to no avail. So first of all, I apologise if I have missed something obvious.

    Understanding that the drag and drop behaviour only works with the collision polygon, I had to make my sprite into two different parts and pin these two together. All good so far, however on pinning the objects I can only drag one of the two parts around even though I have applied the drag and drop behaviour to both objects and when I use the other part , I am dragging it from its collision polygon.

    Is there something else that needs to be done to allow both parts to drag ? Eventually this sprite might be made up of three or more parts so I want to make sure that it can be dragged from anywhere

    Thanks

    TimCS

  • if you're trying to drag the pinned object, it will have trouble dragging, because it is also trying to stay pinned to the other object. if the objects are overlapping, you can just turn the drag/drop off on the pinned object. if they are not overlapping, you could maybe have the drag/drop and pin switch enabled/disabled depending on which sprite is dragged.. although, there's probably a better way than that, that isn't coming to me right now.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • if you're trying to drag the pinned object, it will have trouble dragging, because it is also trying to stay pinned to the other object. if the objects are overlapping, you can just turn the drag/drop off on the pinned object. if they are not overlapping, you could maybe have the drag/drop and pin switch enabled/disabled depending on which sprite is dragged.. although, there's probably a better way than that, that isn't coming to me right now.

    spacedoubt

    Thanks for you quick response, I will look into this , I would like to be able to drag from either objects , they may be overlapping just though . The only thing is one of the objects coliision polygon is not and intentionally covering its entire body that is why I wanted to pin them this way.

    Is there another form of plugin/behaviour that gets around this ?

    Thanks

    TimCS

  • I'm not the guy to ask about 3rd party plugins.. If something seems even vaguely possible without them, I won't use them. Yeah.. I'm one of those guys ... You'd be surprised how unnecessary most of them really are.

    There probably is though.. but I don't know.

    Best I can figure, whichever one is dragging, shouldn't be pinned. and whichever one isn't dragging, should be. so if you can find a way to switch between the two, it should work.

  • I'm not the guy to ask about 3rd party plugins.. If something seems even vaguely possible without them, I won't use them. Yeah.. I'm one of those guys ... You'd be surprised how unnecessary most of them really are.

    There probably is though.. but I don't know.

    Best I can figure, whichever one is dragging, shouldn't be pinned. and whichever one isn't dragging, should be. so if you can find a way to switch between the two, it should work.

    spacedoubt

    I think I get what you are saying , so when dragging , reverse the pinned logic and vice versa ?

  • spacedoubt

    That works thanks so when object A starts to be dragged and is pinned to object B. I unpin object A from B and then pin B to A and vice versa depending on which object part is being dragged

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