Creating a logic toggle
Posted May 27, 2011
Hey guys,
So I have a func_rotating that I'm rotating backwards and forwards with the SetRotateForward/Backward inputs, and I've been doing this with two separate buttons so far, one for each direction. However I'd like to turn this into a toggle, so that every time the player presses one button, it switches backwards and forwards. There doesn't seem to be a logic_toggle entity or anything of the sort, and the func_rotating's "toggle" input just turns it on and off. Does anyone know how to make a toggle using logic entities so I can make the switch?
Cheers.
Registered users don’t see ads!
Register now!
Posted May 27, 2011
Replied
30 minutes
later
Logic_branch, using the "toggle" input:
Posted May 27, 2011
Replied
5 minutes
later
NocturnalGhost wrote:
Logic_branch, using the "toggle" input:
aha you lovely man, thanks! 
Posted May 27, 2011
Replied
1 hour
later
Can you think of anything else that I would need to do to get this to work? The inputs that should be getting fired from the "OnTrue" and "OnFalse" outputs aren't causing my relays to trigger. I've also tried setting a default value of "true" first and then attempting the toggle just in case it needed an existing value, also no dice :/
Posted May 27, 2011
Replied
5 minutes
later
Sorry, my mistake, the input you use should be "ToggleTest", rather than "Toggle". Toggle just changes the stored state, whereas ToggleTest changes the state, then fires the OnTrue or OnFalse output.
Registered users don’t see ads!
Register now!
Posted May 27, 2011
Replied
19 minutes
later
Ah thanks, that works great; I just assumed toggletest was a debug addition a coder added and had forgotten to remove ;p thanks!