# How to disable the "W" key using a bool?

**URL:** <https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [September 23, 2025, 4:09pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245 "2025-09-23T16:09:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 23, 2025, 4:09pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/1 "2025-09-23T16:09:46Z")

</div>

Hi! I am trying to disable the “W” key when I enter a trigger. First, I created a bool variable in my player character. Then I added a pressed key “W” and connected it to a branch, followed by bringing in the bool variable and connecting it to the branch. I did make the bool variable set to true but where I get lost is that I am not sure what I am connecting to the True and False to disable the W. Also, is the bool variable and branch supposed to be created in he player controller instead?

Then in my level blueprint I have the Begin Overlap for my trigger, followed by Cast To my player character, and then have my Set bool connected to my Cast. Still nothing works works and I am completely lost as to why. Can anyone please help me by showing me an image(s) of what what they did to get something like this working? It would be greatly appreciated. Thank you!

 ![Character_eventgraph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/c/6bc92d3ae131674800679b1f7e36e11fe4385e6b.jpeg)

 ![Level_Blueprint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/8/bf813703bfe166eb5d1bde55d426a25983fb0ca7.jpeg)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 23, 2025, 4:43pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/2 "2025-09-23T16:43:30Z")

</div>

logically if you’re trying to disable it, it should be false. You could rename it from DontMove to CanMove. (not important but does make sense)

Off W dont set the bool, you’ve already done that in your trigger box, just run your logic (ie ApplyMove) off true (assuming its CanMove)

---

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 23, 2025, 5:24pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/3 "2025-09-23T17:24:55Z")

</div>

Am I doing it correct when I am using the Cast To in my level blueprints? Also, should I be doing this in my Character blueprint or should this be done in my Controller blueprint? I am bit confused by what you mean when you say “just run your logic”. Sorry for all the questions, I have been stuck on this for so long.

 ![Character_eventgraph2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/a/0ca48cfc8e1511f34ad96025277b1be5c302349e.jpeg)

---

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 23, 2025, 8:25pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/4 "2025-09-23T20:25:52Z")

</div>

If anyone knows the easiest way to set this up using the First Person Blueprint with 5.6, that would be extremely helpful. Any images would also be helpful. Thank you!

---

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [September 23, 2025, 10:13pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/5 "2025-09-23T22:13:51Z")

</div>

Hi @bigboy2k ,  
Do you want to disable the player’s forward movement when they enter the trigger, or do you have another function bound to the **W** key?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [September 24, 2025, 3:26am UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/6 "2025-09-24T03:26:17Z")

</div>

> [@bigboy2k](#):
>
> I am bit confused by what you mean when you say “just run your logic”.

well by disabling W i assume you mean disable the logic that comes after W. So lets assume that is MoveForward. if you put MoveForward on the true path and Set CanMove to false then it wont fire.

---

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 24, 2025, 2:47pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/7 "2025-09-24T14:47:41Z")

</div>

I actually just want to know how to disable any key when entering a trigger but I am using “W” as an example because I do want to stop the player’s forward movement.

I have looked everywhere and I haven’t been able to find one solid example of how to do this or any video regarding how to disable a single key input during gameplay.

---

<div class="post-metadata">

**Author:** ![jamaraala](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jamaraala](https://forums.unrealengine.com/u/jamaraala)\
**Post date:** [September 24, 2025, 3:16pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/8 "2025-09-24T15:16:06Z")

</div>

If (can Move) don’t process ‘W’ input, else allow movement

---

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 24, 2025, 4:01pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/9 "2025-09-24T16:01:08Z")

</div>

Thanks for the response. I understand what you are saying but I don’t know what that would look like in Blueprint. Do you have a way of showing me what that looks like? Thanks!

---

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [September 24, 2025, 5:56pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/10 "2025-09-24T17:56:41Z")

</div>

First of all what I recommend for testing all of this is to use **Print Strings** so you can see exactly when it’s being called.  
To disable a key there isn’t a node that literally “turns it off.” What you’re really doing is disabling the **logic** that runs behind that input. You could do this with branches, but if you want a cleaner and more scalable solution, the recommended way is to use **Input Mapping Contexts (IMC)** in Enhanced Input  
( Documentation : [Enhanced Input in Unreal Engine | Unreal Engine 5.6 Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/enhanced-input-in-unreal-engine)).

The cleanest and most scalable way to disable a specific key (like **W** for forward) is through IMCs. What you do is duplicate your default IMC (for example, IMC\_Default - IMC\_DisableKey) and in that copy remove the binding for the action you want to disable. In this case, that would be the forward movement action bound to W.  
(IMC Without specific key )

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/c/45c37d125718bfafbb16e9b3452284f410d8ceef.png)  
(IMC Default with all keys )  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/4/2c4de15f21759bc68dec35893fabea0e49e8214f.png)

In your PlayerController, create two events:

- **DisableKeys** : removes the default IMC and adds your custom IMC without the W binding.
- **EnableKeys** : does the opposite, removes your custom IMC and re-adds the default one.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/b/aebfb9fe84ed793b9bceb16efa8621284453d878.png)

From the Level Blueprint (or from your Bluepint ), you simply call DisableKey Event when the player enters a trigger and EnableKeyEvent when they leave, or at any other point where you want to toggle the behavior.  
(Blueprint with a trigger)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/2/8f2852fce7f1f06b3708436e8d9283f9947ad2c7.png)

Level Blueprint

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/0/9506ce29696ddd20c1017959a5bf3d8fe73e1ca6.png)

The advantage of doing it this way is that your gameplay logic stays clean and separated from input logic. Instead of filling your Blueprints with branches and condition checks, you just switch contexts. This also lets you create different “control profiles” and scale the system easily without conflicts.

In case you want to disable it using a Branch, here’s a link where they talk about the topic, so you can better understand how it works:

> [@How do I enable and Disable one key?](https://forums.unrealengine.com/t/how-do-i-enable-and-disable-one-key/422605):
>
> I am trying to enable and disable one key when you enter a trigger box. However you can switch characters with this key but I only want the key to work after you encounter the other player.

- [https://www.youtube.com/watch?v=22rdnK\_B01w](https://www.youtube.com/watch?v=22rdnK_B01w)

And I’m also leaving it set up with an example of how it works. In my case I used **Disable Input** and **Enable Input**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/f/f1fa2fb1d6903afd41b3782a436de433ca0b5093.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/e/70e0a30f8bf76d5cf15f2a1adc720b43fc48e6e9.png)

And lastly, in case you want to know where the movement logic is and how to disable moving forward and backward, I’m leaving you an example with a **Select** and an Enable/Disable Forward/Backward . This disables the forward and backward movement logic whenever the player overlaps with the trigger, and re-enables it when exiting the trigger.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/8/1c88eef0915f35c800e710ac48f178dd7a8ec417.jpeg)

Hope it helps!

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [September 24, 2025, 6:11pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/11 "2025-09-24T18:11:23Z")

</div>

Create a folder called Interfaces in your `Content/FirstPerson/Blueprints` directory.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/0/6c057235b42ff75e40fc5280a1f5e666b8bafab7.png)

In the Interfaces folder create a BP Interface class. Name it `BPI_Pawn`.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/3/fc31384a3a7322a3c630830c245ed0b15b256b59.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/b/39b82355e79e45c2ad98cb479ddd00fba5286ca4.png)

Open the class and create a new Function called `BlockMovement`.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/a/56a7c2c5f66bffe85edf855cf36a4707cd9f35f4.png)

Open your character class, go to Class Settings and Add the Interface.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/9/cc90e394de81611127640ab0cc643c1c77e20fdc.png)

Implement your Interface event. My Blueprint → Interfaces  
Right click the Event and select `Implement Event`

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/d/57d273fdbb2bd708b6a58ed4b9ec39c2601d6364.png)

You should now have an `Event Block Movement` added to your Event graph.

Move the event so it’s inline with the movement input.  
Use a FlipFlop (temp solution to prototype) and setup your Boolean.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/1/15188bc77957aa40fe1963c38e02121ae921d858.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/d/08d64e4da5bd9b6c0bd82603ad8d8e01ebf752a1.png)

Now create a Macro… `Is Movement Blocked`

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/6/316f139d34d0de5f9e316abed35672fd87f7e28f.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/9/bb9ddcf505674213ae07e044690bcebf41739123.png)

Next we add the macro to the movement logic.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/6/ff69bbe857449afa7adae131d26dcf6b6381be10.png)

* * *

**Blocking Actor**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/8/9885f7f854c6588510a771608aad7f9a30a91e40.jpeg)

**Collision Settings**  
We only ever want to `Overlap Pawn` which is the obj type used for the characters capsule component.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/f/26ffc019f64aa8ab56b474497893a068699516a0.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/8/4f8b0c7de2000994f41adb874b6bce372fe6cd56.png)

* * *

We can adjust this to use two Interface Events.. e.g. Disable Movement, Enable Movement

**BPI\_Pawn (interface class)**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/d/5fdb53b77968e352fb31a78a6445141ea1ec8cc6.png)

**Character Class**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/f/dbf22c0be130be2992e0142783632ec898c6127c.png)

**BP\_ForwardBlocking (Actor)**

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/1/d918543ce1cf63d577c9e5e2209c743883721f33.png)

* * *

**Usage**

Add the actor to the map.  
Move to general Location.  
In the Details panel select the Collision component.  
Using the Scale tool adjust as needed.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/c/1dc850e16720ffb3a6ade5e9baaca40f20cf7af3.jpeg)

For finer control of scaling you can use the Transform → Scale, OR adjust the Shape → Box Extent.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/2/c429045f81c6830d7cbc957919005b5b04f9aea8.jpeg)

---

<div class="post-metadata">

**Author:** ![bigboy2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bigboy2k](https://forums.unrealengine.com/u/bigboy2k)\
**Post date:** [September 24, 2025, 6:16pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/12 "2025-09-24T18:16:06Z")

</div>

@BRGEzedeRocco @Rev0verDrive Thank you so much for your detailed responses. This will not only help me but the others out there that may also want to implement this. Thank you, thank you, thank you! 😀

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [September 24, 2025, 6:38pm UTC](https://forums.unrealengine.com/t/how-to-disable-the-w-key-using-a-bool/2659245/13 "2025-09-24T18:38:56Z")

</div>

Disabling “keys” gets trickier if you allow clients to do custom key binds and double mappings.

Also using Player index nodes won’t work in a multiplayer setting.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/5/ab5aa59982c40040979c04ddef5668c9d1e49605.png)
