Why should I set up an enhanced input action event when I can simply use a keyboard event in the game controller? The keyboard button will have no other functions and a change by the user is not required. Or is there no real benefit for an input action in this case?
friend!
That is actually a great question, so let me try to clear things out.
If you wanted to simply: call method when W is pressed, then any solution for this would be correct. But in a real world scenario that's is really never gonna happen. There will always be some "what ifs" at one point or another that will force you to increment the logic of capturing the W key. That's where the Enhance Input System comes in.
So, basically the Enhanced Input System is not just a "different way" to handle hardware input. Is THE way of handling hardware input. That's because, although more complex to implement, it comes ready to handle an array of different situations.
I'll try to give some examples that you would have to learn how to work around if you were to use direct capture of Key Press:
IMC->UnmapKey() / IMC->MapKey()
.Jump
when the player presses Space Bar, but if he's under water he needs to Swim Up
. You could keep track of all different player states in your game and define a different logic for each key and each state, or you could just switch mapping inputs. If you simply switch map inputs (or work smartly with their priority), you need no new logic whatsoever. Just bind every player state to a Input Mapping Context (if there's need of one) and when the player changes state, it changes the mapping. Simple.I'm going to be honest, I could keep going but I think I made my point and I'm also working on a Youtube video about this and I don't want to spoil it all here. xD
Anyway, I hope I could help and, trust me, Enhanced Input System is the way to go.