playMaker

Author Topic: GUI buttons and texture changer  (Read 1638 times)

DanaMazzo

  • Playmaker Newbie
  • *
  • Posts: 11
GUI buttons and texture changer
« on: April 23, 2014, 07:08:12 AM »
How to create GUI Button which will change material on object.
« Last Edit: April 23, 2014, 10:34:49 AM by DanaMazzo »

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: GUI buttons and texture changer
« Reply #1 on: April 23, 2014, 07:13:36 PM »
Here's how I would try it!  :D

On your button:
GUI Button sends event "press"
On "press" adds 1 to a global int variable named "material index"

On your object:
State 1 can be "idle". Use the "int changed" action. When it changes, pass to State 2.
State 2 uses the "int compare" action, once for each new material state:
If global variable "material index" = 1, pass to state "green"
If global variable "material index" = 2, pass to state "red"


States "green", "red", etc use should use the "set material" action. When finished, they should pass back to the main state.

DanaMazzo

  • Playmaker Newbie
  • *
  • Posts: 11
Re: GUI buttons and texture changer
« Reply #2 on: April 24, 2014, 05:58:34 AM »
Huuu, im so sorry, I tried to make and understand what you have describe me but I couldnt.

If you can explain like in video tutorials?
I still didn't learned to think like programer.
Can you describe step by step what to do?
« Last Edit: April 24, 2014, 01:01:41 PM by DanaMazzo »