How do I make a button that toggles by pressing 'e'?
Posted May 25, 2011
Specifically, I want to stop a prop_button from automatically resetting and only rest by the player pressing 'e' on it. So now the button is an on/off switch.
I think I could make it so that the OnPressed will trigger some kind of logic setup for the door that will switch between which output (open or close) it will fire next time the button is pressed. Is that the best way to do it, and which logic entities do i need to use?
Registered users don’t see ads!
Register now!
Posted May 25, 2011
Replied
4 minutes
later
You shouldn't worry about making the switch, visibly, stay in the pressed position. Off the top of my head, you could use a logic_branch to create this effect. Look in my signature and download the "Gel" example, I do exactly what (I think) you are talking about in that example map. VMF is included.
But I have to ask, wouldn't a floor button be better suited as an On/Off switch though? That is pretty much their entire purpose.
Posted May 26, 2011
Replied
7 hours
later
Your Gel map has exactly what I was looking for. And I didn't want to use a floor button because it would require an unnecessary cube, and pressing a button is much more efficient in my opinion than placing a cube on a button. Thank you.