How to stop player taking over the foward axis after initiating a interaction

After i finish the interaction, my player receivers back his input but the “W” key keeps pressed. It only stops walking after i hit the “W” key again. Any ideias how to prevent this?

How are you doing it? Are we talking about Enhanced Input? Or the now deprecated legacy system?

What do you mean Enhanced Input? I’m using input axis from Unreal engine 4 (2.27) I don’t quite understand what you mean. :thinking:
You mean the plugin?

So we’re talking UE 4.27 and the old input method. Got it. Most people have now switched to UE5 + Enhanced Input which is the recommended way of handling things from now on.


My question stands - how are you giving the player input back? It may be a matter of Flushing it if you’re experiencing what seems to be a stuck key.

有一个比较繁琐的方法就是定义一个bool来去避免他的激活,(繁琐但有效)
不过相对来说增强输入不会有这种困扰(可惜他是UE5的特性你无法使用)

Are you a robot? you talk like a AI

啊对,我是CHAT-GPT3.5,你还有什么疑问吗?
相比在这里扯淡,我想你肯定有更好的方法吧?
不然和哥谭市人群有什么区别呢?

Soon I intend to switch to UE5, personally, for personal reasons, I really like Unreal engine 4. It’s so, I don’t know, “Clean”. But anyway. The method I’m using is a check with interface “Does implement interface” And key > Line trace > Does implement interface? >Yes? > Go to another Blueprint and disable player input there, do what you need to do, at the end give the input back to the player. With a little debugging I saw that the input axis always has the value “1” and needs to be reset, reset, and nice to be used again.

Again, how do you do that? Asking for the 3rd time, heh - then I give up. Which node do you use? I can think of 10 ways to rob player of input and then restore it. I’d rather not list them all merely hoping I guess it right. You could have said, I use this:

And this conversation would have been over yesterday… Please be specific if you need help. :innocent: Do you use those nodes:

image

Do you use something else?

Sorry for wasting your time :innocent:

I use disable input and enable input, set input mode game only and ui when dealing with ui.

And the issue manifest after doing the above only? Not when setting input mode?

Yes, my friend.

Try calling both, Enable Input first → Set Input Game Only and tick Flush Input. Do tell whether it helps.

1 Like

It doesn’t work, my friend. I don’t know if these nodes you showed are in Unreal engine 5 but in Unreal engine 4 (Latest version doesn’t have this same boolean). I think the best method in my case is to do a manual flush. Any ideas?

For what is worth, I’m sorry for your time. Thanka my friendah.

Yeah, I remember now this was a horrible issue back then. There’s probably is a hacky workaround where you handle input manually.


A simple workaround would be to not Disable input but have it Branch it - clunky but would work well:

image

Instead of Disabling / Enabling input, you set the var to False / True. You’d need to add this conditional to every input that is using Axis Mapping.

1 Like

I just did some more debugging and discovered that the input type removal method was stealing input from my player. “Set input mode ui only” was the problem. I just used Ui and game. It is fixed now, thanks for the mental help to put the ideas on the table @Everynone. Have a good one. :pray: :slightly_smiling_face:

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