Please or Register to create posts and topics.

Creating a logic toggle

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.

Logic_branch, using the "toggle" input:

http://developer.valvesoftware.com/wiki/Logic_branch

NocturnalGhost wrote:
Logic_branch, using the "toggle" input:

http://developer.valvesoftware.com/wiki/Logic_branch

aha you lovely man, thanks! :)

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 :/

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.

Ah thanks, that works great; I just assumed toggletest was a debug addition a coder added and had forgotten to remove ;p thanks!