Activate action binding from C++
For our game, we're using a custom virtual joystick on a touchscreen. What I want to do is expose the inputs for this joystick as action and axis bindings. This would allow our designers to grab them in Blueprint and use them to code the logic for our player avatar. It would also decouple the input source from the gameplay logic, which means we could trigger the input using other methods in the future.
We're not using the default virtual joystick because we want to support things like dodge on swipe and activating combos with multiple presses
Unfortunately, looking through the documentation and the code, there doesn't seem to be a way for me to implement this without heavily modifying the input systems.
It's currently very easy to bind a digital or axis action to an input device source (i.e. key pressed or gamepad joystick axis), but impossible to trigger the same action from code.
I have two potential solutions to my problem.
The first is that I add Blueprint events to my player controller and disregard the actual action binding, like so:
Our designers will then have to reference the player controller in Blueprint and use these events for input processing. This is not ideal, because it sidesteps the action binding system. This would make it harder for us to trigger the same inputs through different methods at a later stage in our project.
The second option is that I modify the
Am I missing something? Is there an easier way to get what I want?
asked Dec 08 '16 at 08:52 AM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here