playMaker

Author Topic: Swipe 2d Object  (Read 4345 times)

OmeletteDuFromage

  • Playmaker Newbie
  • *
  • Posts: 4
Swipe 2d Object
« on: May 21, 2015, 09:16:06 AM »
Hi,

I have two instances of a sprite prefab in my scene, my prefab contains a swipe action, but when I swipe any place on screen both instances moves to the swiped direction.

My question is, how can I setup it in order to move only the instance under my finger?

If possible, could someone provide a sample scene with it?

thanks in advance
« Last Edit: May 21, 2015, 09:45:18 AM by OmeletteDuFromage »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Swipe 2d Object
« Reply #1 on: May 21, 2015, 09:49:17 AM »
Hi,

 what system are you using to detect a swipe? Input.touches or else?

 Bye,

 Jean

OmeletteDuFromage

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Swipe 2d Object
« Reply #2 on: May 21, 2015, 10:14:26 AM »
Actually I'm only using the swipe gesture from playmaker. Is it necessary to use a third party asset  to do it?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Swipe 2d Object
« Reply #3 on: May 27, 2015, 02:25:31 AM »
Hi,

 yep, you'll need something a lot more complete to do swipe on specific targets.

 Typically, you can do it all with PlayMaker but it's pretty advanced, as it required both a manual management of swipe and object detection.

 you could try the following:

 Detect using "Touch Object Event" action when a finger begins, and then while this finger ID is not ended or canceled, catch the swipe event as usual, but only perform the movement if the swiped happened during the lifetime of this finder ID.

 Does that make sense?

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Swipe 2d Object
« Reply #4 on: May 27, 2015, 04:04:51 AM »
Hi,

 Just a quick note on your project, I strongly recommend you don't use the legacy UI system, and move to the new Unity UI. It's fully supported with PlayMaker ( on the wiki and Ecosystem), and you'll have a lot more possibilities to create complex interfaces ( something you'll quickly find impossible without scripting with the legacy UI)

Bye,

 Jean

OmeletteDuFromage

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Swipe 2d Object
« Reply #5 on: June 01, 2015, 02:27:43 PM »
Thanks Jean,

Following your logic I was able to move only one sprite no matter what. But I still have to touch to select the sprite and then swipe to move. is there any asset that I can use to get it done?

Thanks