# Change Variable with button press (enhanced input) UE 5.51

**URL:** <https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991>\
**Category:** Programming & Scripting\
**Tags:** Variable, controls-mapping, beginner, unreal-engine, question\
**Created:** [February 14, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991 "2025-02-14T20:30:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UnknownDinoDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnknownDinoDev](https://forums.unrealengine.com/u/UnknownDinoDev)\
**Post date:** [February 14, 2025, 8:30pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991/1 "2025-02-14T20:30:13Z")

</div>

So I am trying to change a float variable to 1 by pressing the space button.  
I try to print it on a string but there is no feedback.

If I use analog stick it works great!

Can anyone help?

My setup:

 ![Input Action](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/c/acc31347dd6bc85ef410438e7c1529037ccce359.jpeg)  
Input action

 ![IMC Default](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/7/b/17b15b5e451ae6a193e8f6bdb2906300d0a542a6.jpeg)  
Input mapping context

 ![blueprint application](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/9/9a9eeefc1eb39c2f37bfbaceb31fc3bbbaf61a04.jpeg)  
Blueprint setup

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [February 14, 2025, 9:30pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991/2 "2025-02-14T21:30:11Z")

</div>

Hey @UnknownDinoDev!

Are you sure you don’t have anything else operating using the spacebar? That would be my first thought since First and Third Person templates have it used for Jump right out the gate.

What about “Keyboard 1” or "Keyboard ‘E’ " etc? Do those work?

Let us know!

---

<div class="post-metadata">

**Author:** ![UnknownDinoDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnknownDinoDev](https://forums.unrealengine.com/u/UnknownDinoDev)\
**Post date:** [February 15, 2025, 7:46pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991/4 "2025-02-15T19:46:00Z")

</div>

Hey, sorry!  
After some more testing the _ **keyboard 1** _ and the _ **face buttons** _ on gamepad  
(they both work) I realized that the problem is the spacebar on keyboard and the shoulder buttons and triggers on gamepad!  
Any Idea what could be causing that?

---

<div class="post-metadata">

**Author:** ![UnknownDinoDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnknownDinoDev](https://forums.unrealengine.com/u/UnknownDinoDev)\
**Post date:** [February 15, 2025, 8:09pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991/5 "2025-02-15T20:09:34Z")

</div>

After some more search I realized you were right. The problem was that the input was being consumed before by the VR spectator.  
THANK YOU!!!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 17, 2025, 8:10pm UTC](https://forums.unrealengine.com/t/change-variable-with-button-press-enhanced-input-ue-5-51/2332991/6 "2025-03-17T20:10:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
