V0.1.2 Devlog - LH
"Issue Receiving Input In UI Menu"
Author: Liam Hans
Posted on: 07/19/24
THE PROBLEM
This week was all about setting up our vendor system, and with the vendor system comes the vendor shop. Ideally, we wanted to set up the shop to be relatively dynamic and quick, so we could tab in and out of it relatively easily. With that being said, we wanted the shop to be openable and closable via a key press, rather than opening with a key and closing with an 'X' or 'Back' button. We want that functionality too, but why limit ourselves to that? So, I thought setting this up would be pretty quick. If we press our interact button near the vendor, open the shop, if we press it again, close the shop. Alas, it was not quite that simple. The issue with this method is that when we open a UI menu, we set the InputMode to 'UIOnly', which unfortunately disables keyboard input. Without keyboard input, we weren't able to close the shop with another press of our interact button, and were only limited to the X or Back button option. I'm not exactly sure why Unreal set it up this way, considering we may want to give UI input via the keyboard as well, but we were stuck with this issue nonetheless.
THE SOLUTION
I thought my solution to this would be rather straightforward, I could just not set the InputMode to UIOnly and set it to UI and Game Only and simply disable my controller's input so that my player wouldn't move while in the shop. Well, if I disabled my controller's input, that disabled all input, meaning I could not give keyboard input to close the shop once again. I then remembered a similar issue that I spoke about in my blog post last week, where I discovered two rather handy nodes: IgnoreLookInput and IgnoreMoveInput. I thought, "why not try these out and see what happens". Well, turns out they worked. At least, sort of. I was able to ignore my movement input, which stopped the player from moving when in the shop, however action input (attacking, casting magic, changing camera angles, etc.) was not being ignored. So, our player couldn't move in the shop, but they could still perform actions. This would not do. We decided on adding a flag called 'UIMenuIsOpen' which we could then check on all action inputs before performing the action, seeing as we wouldn't really want to attack, cast, change camera angles, or the like while a UI menu is open anyways (a fully immersible UI menu, that is).
This solved our issue, and resulted in a UI menu that we could open and close with the click of a key! See below for a video example of our vendor shop (please note that the shop itself is not fully complete so there are many items missing/some jankness to the menu itself).
Get Plight of the Gods
Plight of the Gods
Fight your inner self to heighten your inner self
Status | Prototype |
Authors | acidwalrusdigital, ilrathCXV (FM), KevinHall14, MysticF0x, Lhans |
Genre | Fighting, Adventure, Role Playing |
Tags | 3D, casting, Fantasy, Magic, melee, Singleplayer, student |
More posts
- Devlog Update: Plight of the Gods is Now Live!Sep 05, 2024
- V0.1.3 - KHJul 26, 2024
- V0.1.3-Devlog-ENJul 25, 2024
- V.0.1.3 Devlog - LHJul 25, 2024
- v0.1.3 - DevLog - JRJul 25, 2024
- V0.1.2Jul 20, 2024
- V0.1.2 Devlog-ENJul 18, 2024
- V0.1.1 Devlog-KHJul 13, 2024
- v0.1.1 DevLog - JRJul 12, 2024
Leave a comment
Log in with itch.io to leave a comment.