playMaker

Author Topic: Virtual Press(touch) & hold  (Read 2119 times)

weilies

  • Junior Playmaker
  • **
  • Posts: 74
Virtual Press(touch) & hold
« on: April 24, 2016, 08:08:40 PM »
Good day,

How to trigger a touch & hold event in PM?
I tried to tag mouse down & up event, but they trigger together only when I release my mouse click :(

Thanks for the helps

Regards,
Weilies

weilies

  • Junior Playmaker
  • **
  • Posts: 74
Re: Virtual Press(touch) & hold
« Reply #1 on: April 24, 2016, 08:19:09 PM »
Hi, I jz managed to found this package...
https://www.assetstore.unity3d.com/en/#!/content/27020

Wow, I am gonna download tonight and I hope it works!

weilies

  • Junior Playmaker
  • **
  • Posts: 74
Re: Virtual Press(touch) & hold
« Reply #2 on: April 24, 2016, 08:33:04 PM »
Hi, I jz managed to found this package...
https://www.assetstore.unity3d.com/en/#!/content/27020

Wow, I am gonna download tonight and I hope it works!

i just noticed it required a paid asset

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Virtual Press(touch) & hold
« Reply #3 on: April 24, 2016, 10:16:16 PM »
Break the behaviour down into states like in the attached image.

The Success state could send an event to another FSM to trigger some behaviour. This keeps the Touch FSM nice and simple.

The key is to break behaviours down into simple steps and use smaller FSMs that talk to each other.

You can also think of an FSM like a flowchart, where you're breaking behaviours into simple, discrete steps.

Does that make sense?


« Last Edit: April 24, 2016, 10:17:53 PM by Alex Chouls »

weilies

  • Junior Playmaker
  • **
  • Posts: 74
Re: Virtual Press(touch) & hold
« Reply #4 on: April 25, 2016, 07:45:13 AM »
Hi Alex, thanks and could you share the FSM? ^^

Thanks