Hello,
I have a simple question but I cannot find the answer anywhere. I am wondering how to unbind an action input during runtime in C++.
I am currently using the simple way to bind inputs:
InputComponent->BindAction("MoveForward", IE_Pressed, this, &ACharacter::MoveForward);
but I want, at any moment disable this binding.
Thanks 
Hello FG707,
Iām not sure if this is possible to do, but what are you trying to accomplish by doing this? I may know of another way to do it that doesnāt involve unbinding this action.
Hi ,
I would like to enter a Trigger Volume, enable only one action (Interact) by pressing the āeā key. After having Interacted with this Trigger Volume, i want to disable this āeā key and enable the āvā key to do another action (Evolving) and the ābā key (Back).
In general, I would like to have a character āzoneā state, and a set of keys associated to those states. For example:
- InZone - āeā
- Interacted - āvā, ābā
- Evolving - ābā
Right now, Iām using booleans to achieve this, but I would like to bind and unbind keys instead.
Thanks!
I would personally use booleans and/or a setup using Overlapping Actors from the Trigger Volume but it seems like this will be possible for you. Youāll need to get a reference to the InputComponent from where you set it up and then call the function entitled āRemoveActionBindingā and enter the index for which binding you wish to remove.
For future reference, the way I found this out was with the help of Visual Assist X (built-in Intellisense would work as well) for Visual Studio. I loaded up a C++ project based off the ThirdPersonCharacter template and had a look at the SetupPlayerInputComponent function to look through the available functions for the UInputComponent pointer being used. Looking through existing code to find things like this can be very helpful when you have a vague idea of where the functionality you want may be.
Hope this helps!