playMaker

Author Topic: gui button  (Read 1697 times)

workaholicstudios

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
gui button
« on: November 05, 2013, 06: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
« Last Edit: November 05, 2013, 06:42:28 PM by workaholicstudios »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15050
  • Official Playmaker Support
    • View Profile
Re: gui button
« Reply #1 on: November 05, 2013, 11:11:46 PM »
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

workaholicstudios

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: gui button
« Reply #2 on: November 06, 2013, 06: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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15050
  • Official Playmaker Support
    • View Profile
Re: gui button
« Reply #3 on: November 07, 2013, 12: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