Enhanced Input for Inventory -Kelsey 12/13/2023


Before trying to implement game controller capabilities I had the inventory set up as an action mapping for pressing I on the keyboard. This was set up with a Boolean to either open or close the inventory menu. When setting up the action mapping for the controller I used the input for gamepad d-pad down button along with the I keyboard input in order to open or close the inventory. This caused issues and the inventory would flicker on and off when trying to open it. I also tried doing a key pressed event directly in the blueprint third person class for I on the keyboard and gamepad d-pad down button, and this worked for the keyboard but did not work for the gamepad input. It would open the inventory with the gamepad input but wouldn't register closing.

The solution to this issue was to use the enhanced input plugin that Unreal has. We had already used this plugin for a couple different inputs for pulling up menus. I had to set up the enhanced input and add it to the IMC_Default class that holds all the enhanced inputs. Within the IMC_Default class I added both the keyboard I button and gamepad d-pad down button as input. Then in the third person class I called the enhanced input for inventory and used the started parameter to put the logic for calling the inventory menu. Instead of the logic I had before with a Boolean and checking if it was already open or closed I had a call for adding the inventory widget to the view port. This fixed the issue and can now open and close the inventory menu with both keyboard and controller input. Below I show the updated functionality for calling the inventory menu along with the disconnected past functionality.


Files

MystiMayhem.exe 828 MB
Dec 13, 2023

Get MystiMayhem

Leave a comment

Log in with itch.io to leave a comment.