Setting a widget inside a main HUD to mouse position
I'm trying to make a tooltip appear at the mouse position. When I add the widget directly to the viewport the set position in viewport is working, the tooltip appears at my mouse position. But I want to set the ZOrder of the widget so it appears above my inventory screen. So I tried adding the Tooltip Widget to my main HUD blueprint along with all the main HUD panels like inventory, skill book, character panels. Now I'm trying to "Set Position in Viewport" on the child widget (item Tooltip) inside the main HUD. But the "Set position in viewport" is not working on the child widget.
When I set the "set position in viewport" on the entire HUD, it works, the entire HUD is following my mouse position.
Why does "Set position in viewport" only work on the entire widget blueprint, and not on added child widgets?
So in short, when I don't add the Tooltip widget to the main HUD and add it to the viewport seperately from the hud, the mouse position is working, but the tooltip appears underneath the inventory panel.
When I add it to the main HUD, the set position in viewport is not working and the tooltip appears at the position where it's positioned in the HUD Designer tab.
asked Oct 08 '16 at 12:22 PM in Blueprint Scripting
Rebel Camp Games
I found a solution. It is not possible to set Z-order between different widgets. i.e. between my main HUD widget blueprint and my ItemTooltip widget blueprint. But you can make sure that the one that needs to appear on top of the other one is added lastly to the viewport with "Add to viewport". Since my itemTooltip is added to viewport in a different blueprint it was being added to the viewport at the same time, because both are in OnBeginPlay. I ended up adding a "Delay" node set at 0.01s before adding the ItemTooltip to the viewport to make sure it is added after the HUD. Now the tooltip appears on top of my HUD panels. :)
answered Nov 09 '16 at 06:14 PM
Rebel Camp Games
Follow this question
Once you sign in you will be able to subscribe for any updates here