playMaker

Author Topic: Touch action for 2D object  (Read 650 times)

ShazBang

  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
Touch action for 2D object
« on: January 02, 2017, 05:16:48 AM »
I have a sprite that I would like to be able to touch, and have it respond to the user's input. However, I can't find an actual Touch action to kick things off, Mouse Down doesn't work and says I need a collider on the sprite, which still doesn't work.

What should I do?

Thanks.

edwardr

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: Touch action for 2D object
« Reply #1 on: February 21, 2017, 08:10:09 AM »
do you mean something like that:
http://hutonggames.com/playmakerforum/index.php?topic=14401.0

I'm able to move an object, but it doesn't work correctly. Maybe it gives you some idea for your problem

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14014
  • Official Playmaker Support
    • View Profile
Re: Touch action for 2D object
« Reply #2 on: April 12, 2017, 11:52:17 PM »
Hi,

 yes, Sprite must have a collider2d to start responding to touch inputs.

If mouse down doesn't work, you have problem, touch won't work too.

I suggest using EasyTouch or InputTouches on the asset store, they both have proper PlayMaker support and will provide proper touch support and all the gestures we generally associate with touches.

 Bye,

 Jean



HeathClose

  • Full Member
  • ***
  • Posts: 226
    • View Profile
Re: Touch action for 2D object
« Reply #3 on: April 13, 2017, 06:09:00 AM »
none of these will work?



on the ecosystem there is even more

can the collider be a trigger?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14014
  • Official Playmaker Support
    • View Profile
Re: Touch action for 2D object
« Reply #4 on: April 17, 2017, 11:45:33 PM »
Hi,

 yes, they all should work for sure. But these action are raw and the work done inside Input.touches and easy touche is massive in terms of functionalites, I would definitly suggest for the sake of learning that you try to create your own library of touch events using raw actions and you'll quickly see how complex and painfull this is... hence why I suggest you go for these assets which will save you days/weeks of work.


a collider can be a trigger for touches yes.

 Bye,

 Jean