# How to make floating widgets?

**URL:** <https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286>\
**Category:** UI\
**Tags:** floating, unreal-engine, Widget, question, Blueprint\
**Created:** [September 23, 2017, 3:17pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286 "2017-09-23T15:17:07Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 10:50pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/21 "2017-09-23T22:50:44Z")

</div>

With the earlier version, that pop ed up everywhere worked only with pressing a key, with left mouse button that didn’t work

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 10:58pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/22 "2017-09-23T22:58:26Z")

</div>

This is the earlier version, it pops up everywhere, now I deleted the ground cube object,

this one seemed to work, only with key press tho, and it didnt focus the center of the object, and also could click in the path(big cube)

 ![214399-screenshot-7.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/a/edaebd9c246baead33af59036de9e10d1a2ebbff.jpeg)

this is the one, where i deleted the path (big cube) and its just empty space but the widget still pops up in the same spot like in the image below, doesnt matter where do i click in the path

 ![214400-screenshot-8.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/3/9731af535f5f233a55d3242c9381fe58951a0b18.jpeg)

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 10:59pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/23 "2017-09-23T22:59:23Z")

</div>

If its possible, when i click on an object, it gets the objects middle not the side of it or something, so the widget shows up in the same spot, and not depending on my click

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 10:59pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/24 "2017-09-23T22:59:30Z")

</div>

That should do it, are you sure about the tag being correct and present on all components?

> I put a cube ont he map and duplicated  
> it many times, the ones that supposed  
> to open widget have tags

You used a basic cubs from the _Modes_ tab?

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:01pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/25 "2017-09-23T23:01:50Z")

</div>

Yes i used that , after all the cubes were on the map i seoected all of themamd gave them a tag

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:02pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/26 "2017-09-23T23:02:01Z")

</div>

Them and \*

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:05pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/27 "2017-09-23T23:05:40Z")

</div>

Use HitComponent-\>GetWorldLocation for this.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:14pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/28 "2017-09-23T23:14:34Z")

</div>

I just dropped some basic cubes, gave them a tag:

[https://i.gyazo.com/0aa8c22d60239a76d4eaf413771faef5.mp4](https://i.gyazo.com/0aa8c22d60239a76d4eaf413771faef5.mp4)

And here’s the entire code:

 ![214421-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/e/66efc1e1298281022ce1533ac9de697b230f0cb1.png)

My advice at this point would be to put Print nodes everywhere and do some debugging.

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:22pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/29 "2017-09-23T23:22:33Z")

</div>

is this the way to put tags right?

 ![214424-screenshot-5.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/c/cdcc22ff20973cfc15ef0967efb5e4dc2adcf93f.jpeg)

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:23pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/30 "2017-09-23T23:23:05Z")

</div>

what blueprint are you in?

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:25pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/31 "2017-09-23T23:25:34Z")

</div>

when I put the “component has tag” node in it stops working

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:28pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/32 "2017-09-23T23:28:14Z")

</div>

oh actually, its working finally, but ive got another problem, and if i click on a cube on the right side, it goes out of the screen, same for the ones on the botton

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:29pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/33 "2017-09-23T23:29:00Z")

</div>

Your tag reads _tag01_ but in the previous screenshot it was _kenyer_ when you tried to detect it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:29pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/34 "2017-09-23T23:29:20Z")

</div>

Good. I was getting worried.

You will need to compare and adjust screen location and shift the widget up, down, left, right.  
If the Screen Location X is less than half the widget size, you shift it by that amount to the right and so on.

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:32pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/35 "2017-09-23T23:32:16Z")

</div>

If i want to set it to actor on click event, or touch event nothing happens, on phone i wont have a cursor so this is a problem

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:33pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/36 "2017-09-23T23:33:35Z")

</div>

You use input touch on mobile, right?

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:34pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/37 "2017-09-23T23:34:56Z")

</div>

with touch 1 event it seems like ok, but still  
that part of the widget is out of the screen, same for the bottom side

 ![214425-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/5/e55191b024104f774ad4e1c7a1af6a831fec04f2.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:35pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/38 "2017-09-23T23:35:47Z")

</div>

As I said above:

> You will need to compare and adjust  
> screen location and shift the widget  
> up, down, left, right. If the Screen  
> Location X is less than half the  
> widget size, you shift it by that  
> amount to the right and so on.

---

<div class="post-metadata">

**Author:** ![Shaaw9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shaaw9](https://forums.unrealengine.com/u/Shaaw9)\
**Post date:** [September 23, 2017, 11:38pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/39 "2017-09-23T23:38:12Z")

</div>

I have to do that in blueprints or in widget options?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2017, 11:46pm UTC](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286/40 "2017-09-23T23:46:25Z")

</div>

You can do it here:

 ![214416-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/0/890d3adb5ca545b8c3f7991500d597a39d47e90f.png)

[Previous page](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286.md?page=1)

[Next page](https://forums.unrealengine.com/t/how-to-make-floating-widgets/405286.md?page=3)
