Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: erniesbot on May 15, 2015, 09:40:13 AM
-
Hi guys,
Apologies if i've overlooked something very basic here but I have the following issue.
I'm creating a UI system that needs to be navigated via a gamepad. I can navigate between the buttons fine, but I can not find an action which is triggered when a button is highlighted (not pressed).
There is a similar function for mouse use "UGUI / ON POINTER ENTER" but this does not work when the button is selected via a gamepad (or keyboard arrow keys).
To summarise, what I want to happen is: When ButtonX "is selected" --> Do somthing
Is this possible or am I overlooking something simple here? :o
Cheers!
-
Hi,
interesting question. I don't know, I have never tested this. Let me run some tests and research on this. Please bump me mid next week if you haven't heard back.
Bye,
Jean
-
I was trying to do this to get an inventory system working so when you selected an item in the inventory it would display an image + string and I couldn't get it working- would be great to have an "on Selection" action or something similar-
-
Hey guys!
Think I found a solution to this...
First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.
Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"
Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".
Boom! 8)
-
^ Thats how you can do it.
The UI event system is pretty robust, you really should look into all of the features that the UI system offers and take advantage of them.
One problem I found was that you can't target which FSM it sends the event to, so just make sure you have one FSM and it won't get confused. I think if you have more than one then it just sends it to the first FSM script in the inspector stack.
-
Hey guys!
Think I found a solution to this...
First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.
Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"
Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".
Boom! 8)
Awesome! Thank you :)
-
You can also use PlayMakerUGuiPointerEventsProxy script.
-
Hey guys!
Think I found a solution to this...
First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.
Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"
Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".
Boom! 8)
For some reason it doesn't work for me :(
PlayMakerUGuiPointerEventsProxy however worked.
-
I did it.
create a global event like "Sound"
add event trigger to the button
drag to button to event trigger
and select playmakerFSM.sendremoteFsmevent
-
Hi,
Yes, that's one way, also, ugui now feature new actions to listen to all possible Unity UI events, like uGuiOnSelectEvent action
Bye,
Jean
-
Hi Jean! :D
Just wanted to ask where to to access those actions?
Thanks for following up on this!
-craigz
-
Hi,
they are all accessible via the Ecosystem (https://hutonggames.fogbugz.com/f/page?W1181) which sources itself from various public github reps like this one: https://github.com/jeanfabre/PlayMaker--Unity--UI
the easiest way is to get the Ecosystem browser and you can access many custom actions, samples and packages like the uGui Package.
Get the Full package for ugui and it will contains all the related custom actions to work with ugui.
follow me on twitter to get instant updates :)
https://twitter.com/JeanAtPlayMaker/status/871638950997372928
Bye,
Jean
-
Hey Jean!
Sorry should clarify, was looking specifically for the "uGuiOnSelectEvent" action! I forgot to update to the latest :D
Thanks again! :D
-craigz
-
Hi,
they are all accessible via the Ecosystem (https://hutonggames.fogbugz.com/f/page?W1181) which sources itself from various public github reps like this one: https://github.com/jeanfabre/PlayMaker--Unity--UI
the easiest way is to get the Ecosystem browser and you can access many custom actions, samples and packages like the uGui Package.
Get the Full package for ugui and it will contains all the related custom actions to work with ugui.
follow me on twitter to get instant updates :)
https://twitter.com/JeanAtPlayMaker/status/871638950997372928
Bye,
Jean
I have problems with new actions, what is minimum Playmaker version requirement?
You can also use PlayMakerUGuiPointerEventsProxy script.
If you don't support navigation with gamepad or keyboard, then you can. But if you do, PlayMakerUGuiPointerEventsProxy will not help.
-
Hi,
1.8.1 is the minimum I think,
- what version of PlayMaker do you have
- what version of uGui do you have ( in the changeling.md inside the ugui folder)
- what version of Unity?
- what problem exactly do you have?
Thanks,
Jean
-
Bumping this to say that the Trigger Event worked, but the action "uGuiOnSelectEvent" didnt for me.
-
Hi,
Can you try with UiOnSelectEvent, PlayMaker has now UI support built in.
Bye,
Jean