how to single drag an actor when multitouch?

rdcuberdcube Member Posts: 361
edited November -1 in Working with GS (Mac)
Hi y'all,
I have a couple of actors on screen but I only want to be able to move one at a time.
When I touch multiple at the same time, the actor triggers several others and they all 'collide' and/or get grouped together.

I have set the 'touch.count' = 1 and play with less than and less than equal to 1, but none seem to work.

I tried following a couple of threads in relation to multitouch and drag/drop, but no sample/demo to follow with my need.

Any tips would be appreciated.

Thanks!

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I don't know if it will be acceptable for the game you are making but when i had this problem the easiest solution was to make the objects collide with each other. You could try putting the collide behavior within a "when touch is pressed" rule. But this will cause the dragging actor to push the other ones around which may not be acceptable.
  • RHRH Member Posts: 1,079
    Check my profile, there is a game with a solution to this, or at least I think it's a solution to the problem you are having.

    EDIT: here it is... http://gamesalad.com/game/play/81660

    P.S. I don't really understand so that probably won't help (it's too early here :( )
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Or create a game Boolean called dragging.

    In each draggable actor have a rule that says when game.dragging is false and touch is pressed change game.dragging to 1, constrain x and y to touchX and touchY. Otherwise change game.dragging to 0.

    Put the touch rule within the game.dragging rule and put the change to 0 in the otherwise of the touch rule.
  • rdcuberdcube Member Posts: 361
    Thanks for the suggestions, I tried them, but I think the logic is off.
    On scitunes idea (when dragging change to false) is set on all actors, so that means that when one of them clicks, it triggers to true, making none draggable.

    I'm not on my Mac to try RH demo, but the main issue to solve, is being able to drag one actor at a time regardless of how many fingers are on screen.

    I submitted my app last night (hope it gets approved by Halloween); but if anyone has a solution to my problem (or test RH demo to test on device for selecting/touching more than one at a time), I might reject the binary and resubmit or have it as an update.
  • RHRH Member Posts: 1,079
    Ah right, I think I understand now. I don't know if my demo will help as I can't test on an device.
  • rdcuberdcube Member Posts: 361
    ok, I tested RH demo and it has the same issue I have.
    If you select all at the same time, they get grouped together...almost impossible to break apart :(

    Any other suggestions?
  • RHRH Member Posts: 1,079
    Is this testing it on a device?
  • rdcuberdcube Member Posts: 361
    yes, I tested on iPhone.
Sign In or Register to comment.