Making a door open with a switch
I have an issue with a blueprint I'm trying to set up. I'll explain it now as best possible. What I have is a door that requires a key input to open and close, with a trigger box on it. In the same blueprint I have a switch, also with a trigger on it. The intent is that the door is locked until the player has used the switch, at which point they will be able to go to the door to open it.
My problem is that when I press F to use the switch, it turns on (one mesh hides and the 'on' variant unhides), which is fine, but standing in that same spot the switch trigger is still active, even though I have set a node to destroy it. This means that I can continue to press F on that spot to open and close the door, which isn't what I want. I assume this is a problem because I'm using 'F' as the input for both actions, but what I want is:
If I leave the switch trigger and head over to the door one, I can use the door trigger as intended, and if i go back to the switch it no longer operates. Basically, it seems as if the switch won't destroy properly until I leave the trigger area.
Any ideas what I've missed? Am I actually doing the right thing here anyway? (should switches for doors be contained in the same blueprint, can they be created separately and links created between blueprints somehow?)
Thanks for any advice, have attached my blueprint setups below. This one shows the inputs for the switch(s):
This one is the door trigger inputs:
Another option may be to use a bool variable associated with your switch blueprint that is defaulted to true called say "canPressSwitch". When you detect the press switch event, set it to false, and have a condition in your switching flow that checks for the "canPressSwitch == true" and only allow the press to proceed if that condition is valid?
Why are you not disabling input on the switch once activated? That would seem to be the fix since destroying the component does not stop it from functioning.
You could also add a branch if you needed it after the overlap to check if the switch has already been activated so it doesn't enable input again.
answered Jul 16 '14 at 07:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here