playMaker

Author Topic: Using Playmaker to control light intensity level with two button  (Read 1511 times)

andrew_chen

  • Playmaker Newbie
  • *
  • Posts: 2
Using Playmaker to control light intensity level with two button
« on: December 29, 2015, 02:03:50 AM »
Hi,

I am using Playmaker and NGUI to control a spot light to different light intensity level.

I know how to add different state on a button and add "set light intensity" action , in other words, I could also decrease intensity.

However, if i want to control this light by two button, one for increase and another one for decrease. Some logic problem come out. Only one button could work. In addition, if I increase light to level 7, how could I synchronise this information to decrease button let it decrease intensity from 7 ? There have some logic problem but i did not figure it out  :'( :'(

Hope someone could give me some advice or example to achieve it.
« Last Edit: December 29, 2015, 02:07:13 AM by andrew_chen »

shermanftw

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Using Playmaker to control light intensity level with two button
« Reply #1 on: December 29, 2015, 02:25:27 AM »
I would create a float and have that float interpolated (might be thinking of the wrong action) when the button is clicked. Then have the light always reference that float value. I have not tried this yet but it might work.

andrew_chen

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Using Playmaker to control light intensity level with two button
« Reply #2 on: December 29, 2015, 04:48:20 AM »
Hi,

  Thanks for your apply. I've tried your suggestion and finally get some result but still have some problem. I set "add intensity" button with different state, each stat have "set light intensity" and "set Fsm Float" action. I hope that another button could using "get Fsm Float" and using "Float Switch" to change the state.

But something went wrong while I try to get FSM float.

Here might be the problem: I setting am float variable with initial value 0 call "intensity" in " get FSM float", but while I start the program the "get FSM float" action never really get the float value from another button's state, it just stay on value 0.

Does I miss setting anything?