playMaker

Author Topic: [SOLVED] Simple Button in UI for touch help  (Read 1707 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
[SOLVED] Simple Button in UI for touch help
« on: January 18, 2019, 02:49:17 PM »
Hi,
Can someone explain how I can make a simple button for touch.  I have tried using the OnClick() Runtime event thing, sending a string etc, but its not firing the event.
I'm obviously doing something wrong.  I just need a little help with it.  I'm using Playmaker 1.9 and in the UI actions,  I cant find anything that I could use to fire a touch event.  Please help, I'm going mad
« Last Edit: January 19, 2019, 10:55:29 AM by Splankton »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Simple Button in UI for touch help
« Reply #1 on: January 18, 2019, 05:48:38 PM »
There are built-in UI Events in PlayMaker:
https://hutonggames.fogbugz.com/f/page?W128

Quick setup:
Start a new scene.
Add GameObject > UI > Button.
Add an FSM to the Button.
Add a transition with UI CLICK event.
Press play and click the button, you should see the transition trigger.



Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Simple Button in UI for touch help
« Reply #2 on: January 19, 2019, 10:54:32 AM »
Ok, fixed it now. I was doing everything right, just didnt have the EventSystem GameObject added, which I only noticed by doing what you suggested in a new scene.  Thanks Alex

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: [SOLVED] Simple Button in UI for touch help
« Reply #3 on: January 19, 2019, 11:35:59 AM »
I hate forgetting the EventSystem! It seems like Unity should warn about this. Maybe I'll add it to PlayMaker...