For a prototype building system I want the player to be able to build different structures by pressing one of the number keys. For that I have set up an Input Action IA_Build with the following configuration.
On my FirstPersonCharacted Blueprint I add this mapping context and when the input action is registered I am able to build a structure. But how can I disambiguate which Structure to build? My action Value always resolves to “0” no matter if I clicked “1” or “2” on the keyboard.
All I can do in Input mappings is apply modifiers, but anything * 0 is 0 so I guess that is not the way.
All examples I could find regarding input mapping deal either with movement (2d) or unambiguous actions (bool).
Sorry for so many edits, I originally made an explanation about how you can use Axis 2D to make those inputs do different things, by negating one of them using modifiers. Then I understood what you were actually trying to achieve, it was not just about 2 buttons right they were just for representation? So I deleted my response after realizing that and looked at your image more carefully. I see you’re turning the action value to string, while you should be doing the opposite. Those are just keys that are required to press in order to trigger the input actions, they don’t change any values of it. I did some research and found these posts explaining how you can achieve this:
OK thanks that should work. I think my misunderstanding was that I thought that the actionvalue would somehow relate to the key pressed while it actually (at least that’s what cgpt claims) is 1 while the key is pressed and 0 when it has been released.