Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: vyn_halcyon on December 16, 2015, 04:34:41 AM
-
Hi folks,
I have added a Unity dropdown menu, the tickable options of which return a value (0, 1, 2).
I want to assign each number (representing the dropbox options) a unity.gameobject to activate and disable. Sort of as a toggle.
I.e. ticking a box to make an object appear while making the other 2 objects dissapear.
My plan is to to let the dropdown.value decide which FSM event to send.
I.e.
(pseudocode)
if dropdown.value = 0
activate gameobject Nr. 1
deactivate gameobject Nr. 2
deactivate gameobject Nr. 3
if dropdown.value = 1
activate gameobject Nr. 2
deactivate gameobject Nr. 1
deactivate gameobject Nr. 3
etc.
I can also set the FSM to be "recursive" on the activation, so I can turn it into a toggle.
Anyone know a JavaScript for this sort of thing?
-
I'm not sure if this is the easiest way but I did this by sending an event to playmaker on value change, then the FSM can get the property of the dropdown label, store it in a string, fire off an event using that string and apply the properties you need.
If anyone knows a cleaner method do let us know.
(http://i.imgur.com/AjwpBFk.png)
-
Ha7den, what events are in that listener state? Even after reading this thread, I can't figure out how to use the dropbox with FSM.
-
Hi,
Good point, It wasn't supported until now by the Unity UI proxy on the wiki. So I made an update and now it will work without any fiddling around.
https://twitter.com/JeanAtPlayMaker/status/747330976750018560
(http://i.imgur.com/q64hObG.gif)
so you can download it from the Ecosystem or wiki (http://j.mp/1I1akKU)
Bye,
Jean
-
Arg, I'm still not understanding how to set this up.
All I want to do is tie the pulldown selection value to a texture in a material, so the selection "concrete" in the pulldown triggers a "set material texture" with a concrete texture, then wood, plastic, etc.
here are my questions:
what specifically do I download in the ecosystem to update the pulldown menu?
how do I set up the pulldown to trigger a material change?
here's a video showing my attempt
https://www.youtube.com/watch?v=M-v_W6cHDgs (https://www.youtube.com/watch?v=M-v_W6cHDgs)
-
Also I'm getting "UI target is not a valid UI component" on my uGui component proxy.
-
Hi,
What version of Unity are you using?
Bye,
Jean
-
I'm using 5.3.5p5
I got everything working by starting a new project and re downloading and importing all the playmaker packages having to do with the uGUI.
-
Hi,
ok, so you could also update on your existing project right?
Bye,
Jean