Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: gecko on October 27, 2015, 09:27:22 PM
-
I'm just starting to use Playmaker with uGUI, but obviously not quite understanding it. Screenshot shows the first two actions in a simple FSM--this is for an audio mute button (that deactivates the Audio Listener on the Main Camera). But it doesn't seem to do anything. The toggle responds to a click, but that's just the basic uGUI toggle function. The FSM isn't responding to the click. Can anyone tell me what I'm doing wrong?
TIA!
Dave
-
Hi,
You should set toggle in this way :
(http://s25.postimg.org/en4iie3rj/Toggle.jpg) (http://postimage.org/)
You can put anything you want to toggle in toggle on and off state ofc.
and the send event does not need the UGUI / ONCLICK transition :)
-
Thanks so much! But I'm stuck already--on the uGUI Toggle On Click Event, there is no "toggled" option among the many different Add Transition options for uGUI. I've checked all the submenus when I right-click on the Action in the FSM. How do I add that?
-
And on the "Toggle is on" action, I can't find the "is on" and "is off" transitions either...
-
And, on the Set Property actions, I've assigned the button with the Toggle script attached to it, but the readout on the action says "UnityEngine.GameObject" rather than "UnityEngine.UI.Toggle" as in your screenshot. Here is my Button inspector--is something missing on it?
-
Hi,
you have to create the "is on" and "is off" transition event yourself. Go to the Even tab of the PlayMaker editor for your fsm, and click on "add event". then you'll find them events in your transition menu when wanting to add transition to a state.
Bye,
Jean
-
Thanks much! Now I think I have it all set up properly...but it doesn't work. I click the toggle, but the FSM still shows "Wait for Click" on the first state. I'm obviously missing something, but where? On the Button inspector? Here's a screenshot of that also.
-
Hi,
do you have the toggle component on your object?
if you have the button component on it, remove that, then click on add component and search for toggle and add that to your object.
-
Thanks for the reply!
The toggle GUI object has Canvas Renderer, Image, and Toggle scripts attached (you can see them in the screenshot in my previous post).
Does anything need to be assigned to "On Value Changed (Boolean)", on the Toggle inspector?
-
I've tried a number of different things for On Value Changed (Toggle.Enabled, Toggle.isOn, PlayMakerFSM.SendEvent "toggled") but none work. And I can't find any information about how to configure that for PlayMaker. Must be simple, right? I just can't figure out what it should be....
-
Hi,
i made i quick video (sorry no sound, i was in a crowded place)
-
Thank you so much for your help, I really appreciate it. Unfortunately, my FSM appears to be exactly like yours, except mine does not work. Clicking the toggle does nothing--never advances to the next state. I have watched your video six times, and cannot see any difference. Here is a screenshot of that first FSM state. Something is wrong, since the toggle is not recognizing a Click. Can you spot what I am doing wrong?
-
Hi,
What is the child of your Mute object (Button) is it text or an image?
If an image this might be overlapping your Mute object,
you can target your actions tho that object instead of use owner or transfer you fsm to that object and remove button script if there is one
-
YES!! That was it! Thank you SO much for figuring this out for me. I really appreciate it!
(There was some weird--at least to me--conflicts between the Toggle functions and the FSM, so I finally set Toggle Transition to None and let the FSM handle everything, and now it works perfectly.)
-
Hi,
i am happy for you that it works now :)