How to enable key after triggering a box trigger

How do I disable the “TAB” key until I enter a box trigger which then enables the “TAB” key to work?

1 Like

hi

I think you should use the BEGIN OVERLAP and END OVERLAP events on your trigger box.
On BeginOverlap, you disable INPUT, and on EndOverlap event, you enable it again with those:

But that will disable and enable all the Keys , not just the TAB one.

one way would be to use a gate to control the flow of the script as shown below in a picture. the gate will only allow the enter pin to be executed when the gate is set to open, so in the example when the actor is overlapped by the player character the gate opens and the tab key works, then when the player ends overlapping the actor the gate closes and the tab key stops working. this type of thing could also be done with variables and branches as well.

It disables all of them I only need the tab on to be disabled

This did not work for me :frowning:

how did it not work? are you not getting overlap events? what actually happened when you tried it?

there also the method in the following picture which does basically the same thing.

Add a Boolean with a branch right after the TAB execution. On overlap set it to true. On end overlap false. Then this will only execute when it’s true and the player is within the trigger volume.

So create a Boolean variable in the character blueprint that has the TAB execution. On overlap, cast to player character (get the boolean variable set it to true) and tab should work. On end overlap do the same thing except set the variable to false.

might depend where these functions are located in her script. If that’s in the level blueprint it’s easy to get that trigger volume reference, if it’s in the player character she’d need to do some casting. Maybe that’s where the difficulty was? Not getting the right references for the right actors?

that is possible. i was writing as if it was in a self contained blueprint, but having all the inputs in the character bp would probably be a good idea. in which case your answer would work well. it really is dependent on the situation.

I used the one before in my level blueprint and it did nothing unless I did it wrong, I will try the new one now Thank you :slight_smile:

what would I connect in your script?

Unless there is something else to this question I answered it on your other post. I’ll link to that post from here

How do I enable and Disable one key? - Blueprint - Unreal Engine Forums