Input Action Mapping Not Firing
Hi, I have an input action mapping called "Drop" setup.
I have tried putting an "InputAction Drop" into my MyCharacter Blueprint and I can see this fire when I pressed the mapped key. There is only one instance of MyCharacter in the level.
However, the same event does not fire if I put "InputAction Drop" into another Blueprint which just consists of just a cube static mesh... (or at least it does not look like it fires in the Blueprint when in Play mode). There are multiple instances of this cube static mesh.
(I am trying to make it so that a player can pick up the cube and drop it... At the moment, I can get them to pick up, but not drop...)
asked Nov 18 '14 at 02:12 AM in Blueprint Scripting
By default only the controller and character receive player input. The easy bypass would be to set "player input" in the defaults of your BP to "Player 0". That way it will receive input from the first player which works just fine for a singleplayer.
However for clean coding I would suggest catching the event in your character (or even controller) and then firing the event in any third actor via casts or saved values (e.g. if you pick up a cube. Save a reference to it in a "Picked up" actor variable).
You can not only use the same function from your character to do multiple things with different actors but you also won't even wonder why something is doing something weird if you press button x because you handle all inputs in your controller (and maybe your character itself).
Debugging just gets easier. And reading that code as well... quite a lot!
answered Nov 18 '14 at 09:22 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here