How do i make a toggle button?

Avatar
TarekCO
10 Posts
Posted May 28, 2011
I have a hard light surface and i want the option to toggle it. But the only thing i could do was 2 buttons. One which enables it and the other disables. But how do i add those 2 functions in one button?
Advertisement
Registered users don’t see ads! Register now!
Avatar
MrLawbreaker
11 Posts
Posted May 28, 2011
Replied 1 hour later
I have managed to do such a toggle button with a math_counter.

My Light bridge is called bridge and is disabled at the start.

The math counter got the following properties:
name: Counter
Initial Value: 0
Min Value: 0
Max Value: 2

The outputs are the following:
OnHitMax - counter - SetValue - 0

OnHitMax - bridge - Disable

OnChangedFromMin - bridge - Enable

The Button got the output:
OnPressed - counter - Add - 1

Avatar
Hober
1,180 Posts
Posted May 28, 2011
Replied 11 minutes later
A button and a cube?
Avatar
msleeper
4,136 Posts
Admin
Posted May 28, 2011
Replied 1 minute later
logic_branch using the "ToggleTest" Output.
Avatar
MrLawbreaker
11 Posts
Posted May 28, 2011
Replied 2 minutes later

msleeper wrote:
logic_branch using the "ToggleTest" Output.

I see, that might be easier ^^

Avatar
TarekCO
10 Posts
Posted May 28, 2011
Replied 1 hour later

msleeper wrote:
logic_branch using the "ToggleTest" Output.

What output do i add to the logic_branch?

Avatar
TarekCO
10 Posts
Posted May 28, 2011
Replied 3 minutes later

TarekCO wrote:
msleeper wrote:

logic_branch using the "ToggleTest" Output.

What output do i add to the logic_branch?

...nevermind i should not ask if i don't experiment myself..

Advertisement
Registered users don’t see ads! Register now!
Avatar
msleeper
4,136 Posts
Admin
Posted May 28, 2011
Replied 25 minutes later
Pretty much. Also don't double post.