Drag and drop issue

alexxxhpalexxxhp Member Posts: 161
edited November -1 in Tech Support
If you have multiple object with a drag and drop how do you keep objects from being drags along when you pick one of them up for example I have 14 items on screen for drag and drop when I pick one up and I go over another by mistakes it picks that one up as well and mixes them up. I want one picked up but the other not to react until I select them and drag them even if I go over them.

Comments

  • butterbeanbutterbean Member Posts: 4,315
    I have that same problem too, anyone have a solution?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    it might have something to do with the whole mouse down options - try changing it to touch?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    i would set a global boolean attribute called "isDragging" or something like that.
    Leave it FALSE by default.

    Only be able to pick up an object when isDragging is FALSE.

    As soon as you pick up an object, set isDragging to TRUE.

    As soon as you drop an object, set it back to FALSE.

    Hope this helps!
    Joe
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    And if I want the object to be dropped in a precise place when is over it (like a snap to grid behavior)?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I made a little demo project explaining this:

    http://gamesalad.com/game/play/30842
  • alexxxhpalexxxhp Member Posts: 161
    how can you make an actor return to the pick up point if dropped in the wrong location an example like I pick up an actor then drag if I let go in the wrong place the actor should return the original pick up point how can that be done.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    You would have to have two attributes, homeY and homeX in the actor.

    You could then have a global game attribute called "dropIsGood" or something like that.

    Then in the actor, a rule that says:
    When game.dropIsGood = FALSE
    move to homeX, homeY

    That's the basic Idea.
Sign In or Register to comment.