Can I have multiple action mappings for one key?
I'm seeing an issue where if I call BindAction for two different mappings but using the same key. The second mapping doesn't seem to fire.
So if I have a mapping for "Mouse Down" that's set to Mouse Button 0 and then in BP I use Event Mouse Button 0 it doesn't seem to fire. If I try using "Mouse Down" in BP instead of "Event Mouse Button 0" it doesn't fire either. It appears that the first even is "swallowing" the input.
How do I fix this?
asked Jun 16 '14 at 05:21 PM in C++ Programming
I ended up fixing this myself. There was a combination of things.
First of all I was using a derived player controller. I had Action Mappings for Pressed and Released in my C++ Controller and was checking the same key in my Pawns Blueprint in some other script.
Turns out I needed to call "Enable Input" on my controller when Begin Play happens on my Pawn. I also needed to set bConsumeInput to false on the mappings I made in the player controller. Took me a minute to realize that BindAction returns you a data structure in code that you need to set bConsumeInput on. In BP this is just a checkbox. I would like to request that Consume Input be a parameter of BindAction or BindAxis. Would have saved me 5 hours.
answered Jun 18 '14 at 11:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here