Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: workaholicstudios on November 05, 2013, 08:35:36 PM

Title: gui button
Post by: workaholicstudios on November 05, 2013, 08:35:36 PM
Im tryin to make some simple controls up down left right.

when i make a gui button to send to the fsm that has translate it works fine, when i add a bool to test that the gui button is not being pressed nothing happens i see it being passed but the object doesn't move any thoughts thanks,

and when i click the button it disappears how can i keep it visible the whole time
Title: Re: gui button
Post by: jeanfabre on November 06, 2013, 01:11:46 AM
Hi,

 Unity GUI elements are not persistant, if you leave the state where you create them they will disappear, you need to perform an operation and then directly come back to the state, then it will be kept visible on screen.

bye,

 Jean
Title: Re: gui button
Post by: workaholicstudios on November 06, 2013, 08:08:42 AM
Ive noticed, ha i kinda got it but trying to get it where if i hold the button down i can continue to repeat the action
Title: Re: gui button
Post by: jeanfabre on November 07, 2013, 02:10:54 AM
Hi,

 uhm, that's going to be tricky yes. I would recommand not using Unity GUI for stuff like that, unfortunatly it is possible but requires scripting, and the very design of Unity GUI system makes it difficult to adapt to PlayMaker environment. Unity GUI is a non persistent system, so your code is executed on every pass, and within Playmaker it's not really working this way as you have States and transitions, and you expect elements to persist between states, so it's very much conflicting here.

Try using GuiTextures or a complete 2d framework like 2d toolkit or nGui.


bye,

 Jean