Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DanaMazzo on April 23, 2014, 07:08:12 AM

Title: GUI buttons and texture changer
Post by: DanaMazzo on April 23, 2014, 07:08:12 AM
How to create GUI Button which will change material on object.
Title: Re: GUI buttons and texture changer
Post by: Breadman 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.
Title: Re: GUI buttons and texture changer
Post by: DanaMazzo 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?