Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Splankton on January 18, 2019, 02:49:17 PM

Title: [SOLVED] Simple Button in UI for touch help
Post by: Splankton 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
Title: Re: Simple Button in UI for touch help
Post by: Alex Chouls 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.


Title: Re: Simple Button in UI for touch help
Post by: Splankton 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
Title: Re: [SOLVED] Simple Button in UI for touch help
Post by: Alex Chouls 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...