Enable and Disable a func_physbox [Solved]
The output of one relay disables the physbox on a delay of 2 seconds. The other enables it on a similar delay. I don't think the delay is the problem, because I wait until it appears or vanishes before pressing the other button.
I want the player to be able to toggle it at will using the buttons. Any ideas on why I am having a problem?
Maybe instead of using logic_relay, have the physbox start enabled, and for the button that enables/disables the physbox, try this output on the button:
OnPressed/<physbox_name>/Toggle
I'm not absolutely sure this will work but try it anyway.
Don't expect that the logic_relay is causing the problem, though. It's so weird... sometimes it works, sometimes it doesn't.
When it doesn't work, do you have to reload the map to get it to work, or does the button randomly work when you press it again?
I personally haven't tried flat-out disabling a physbox, it might have some problems due to it's properties... I guess there are reasons that it is necessary to use one instead of just a brush?
You can do this by either using a math_counter and a logic_case or a logic_branch which 'Toggletests' with outputs firing 'OnTrue' and 'OnFalse'.
If you want a delay between enabling and disabling the physbox, just increase the delay keyvalue inside your prop_button.
When it doesn't work, I have to reload the map. Sometimes this fixes it and other times not. I haven't been able to identify any circumstance that could be related to the problem; it seems to be random each time I load the map.
Is it possible to make it a brush and enable/disable it in the same way? I need to to totally disappear when disabled.
Marise wrote:
The two buttons are part of the puzzle.When it doesn't work, I have to reload the map. Sometimes this fixes it and other times not. I haven't been able to identify any circumstance that could be related to the problem; it seems to be random each time I load the map.
Is it possible to make it a brush and enable/disable it in the same way? I need to to totally disappear when disabled.
Yes it is, I did that with my boss's shield (Portal Bomber). Try that and see if it works.
Thanks, all.