So the way Lyra is set up it defines a HUD as an “Experience Action Set” which gets tied to a “Gameplay Experience” which is fine… i guess… if you want 1 hud per experience.
What i want however is for the HUD to change in real time based on what input you are currently using.
I was thinking maybe i could add multiple widgets for each slot and show/hide based on tags… after all we are provided the “Lyra Tagged Widget” object which seems to do just that… except it doesn’t becuase it’s just full of “TODO”
Also i don’t know that adding 2 widgets to the same HUD “Slot” in the HUD “Layout” is going to work at all. But if i can’t add 2 widgets to the same slot then how do i define 2 types of HUD that i can switch between in a single “Experience Action Set”? Maybe i need to duplicate all the HUD tags so i have HUD.Slot.KBM.Equipment + HUD.Slot.Gamepad.Equipment so that i can put the KBM widget in the KBM slot and the Gamepad widget in the Gamepad slot?
I genuinely have no idea and it takes me absolutely ages testing things because i know so little about unreal and Lyra… so here i am asking the community in the hope that i can save some time
So has anyone got any ideas on ways to go about this that play nicely with Lyra?
Edit: I tested adding 2 widgets to the same slot and that worked fine so it seems the idea of showing/hiding widgets based on tags that get updated when the input changes might not be far off the mark! I will keep going this direction for now… still interested in other people’s thoughts…
I don’t know a lot about UMG or how Lyra uses it, but I’ve been looking around at the widgets they created trying to learn.
I see they are using a concept called “Overlay” that seems to allow them to switch between widgets in a given slot. Take a look at Overlay and how it works, maybe it does what you want.
Lyra uses Gameplay Messages (essentially Tags) to communicate with the UI to turn widgets on and off. There’s a master overlay asset also that positions them. You should be able to duplicate those in the master overlay, create your widgets and call them with different Tags.
“Lyra uses Gameplay Messages (essentially Tags) to communicate with the UI to turn widgets on and off.”
you say that… but have you noticed the code is just full of “TODO” ? it is not implemented as far as i can tell!
i got it implemented… i think… but then i was trying to use Gameplay Tags from within a blueprint to say “turn this thing off” and well… apparently trying to use gameplay tags from within blueprints is a real bad time. every attempt i made to add a tag to the controller ability system component via blueprint failed. in my googlings it suggests that using gameplay tags in blueprints is not really how it was intended.
i find myself wondering if i am actually stupid. or cursed. or idk. why can i not simply create a c++ class and go about my business? why must i spend a day fighting hopelessly with intellisense?
If you look at the main Lyra HUD layout widget, they definitely have some slots there that load different things depending on the input type. They have some optional areas with touch inputs, for example. They also have some things in Overlays which get switched on/off in I’m-not-sure-what circumstance.
I think they’re doing what you want, but as my game is currently MKB only, I haven’t yet bothered to dig deeply into that part of it.
Just in case anyone stumbles on this thread in the future the correct way (a correct way?) to do this is using the “Common hardware visibility border” in your layout. This is a container that will show/hide whatever it contains based on tags. Tags such as input.gamepad or input.kbm. So wherever you need to you can create your unique interfaces in the same layout and simply wrap them in a Common Hardware Visiblity Border to show/hide depending on tags.
So can a widget be wrapped in this border to do the same? I’ve been trying to use Lyra’s Tagged Widgets… But I can not seem to actually change visibility based on given Tag.
Awesome thanks! There must be a special way to use the tagged Widgets. Nick from Epic who created them confirmed they are working. And even my project uses some that are already established. But I can’t get new ones to function.
Hi @anonymous_user_22f53762 , thank you for sharing your notes. You’ve mentioned “create unique interfaces”, so my question: Will the Common Hardware visibility Border automatically detect tags associated with certain gameplay events, or do I need to manually create blueprint interface and add some logic to a specific widget? The latter is feasible, but I am looking for gameplay event tags to keep everything consistent with GAS.
Unfortunately Epic doesn’t allow linking to the video at a specific spot.
Fast forward to 2:10 in the video and Nick talks about exactly the “common hardware visibility border” and gives an example of how it works. I’m sure there are other uses for it as well: