# Weird anchor behavior when using Set Position

**URL:** <https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822>\
**Category:** UI\
**Tags:** unreal-engine, question\
**Created:** [January 10, 2024, 9:28am UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822 "2024-01-10T09:28:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TylerB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TylerB](https://forums.unrealengine.com/u/TylerB)\
**Post date:** [January 10, 2024, 9:28am UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822/1 "2024-01-10T09:28:55Z")

</div>

I’m trying to achieve something similar to the dialogue speech bubbles seen in A Short Hike:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/6/cc6e6e232488d6babf16ecaae9ede1b59475a7ef.jpeg "A Short Hike - Full Playthrough / Longplay / Walkthrough (no commentary)") ](https://www.youtube.com/watch?v=p6UDqtlmJpk&t=230)

My widget accepts a world position vector, then uses this logic here to move it to the right location:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/b/6bb699c32a50b89eb2bbc2a799352076acfd4bfd.png)

Producing this result (which is correct):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/e/8ced10973d08cd9a9368d7c834bad7ed1091294b.jpeg)

As you can probably tell, the anchor is currently at 0,0:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/e/9be647b23eebd803ce4fcfc6d15ee596263b3664.png)

I want to be able to move the anchor so that I can have it located somewhere else; for example the speech bubble tail when I add it:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/3/273486dcd0a8e7e67704a033f2f603437df62265.png)

Except when I do that, everything breaks:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/0/b701a720996c5f18b4aab122eeae96ce9b4f21f9.jpeg)

What am I doing wrong? What do I need to do differently to achieve this speech bubble effect?

---

<div class="post-metadata">

**Author:** ![lordlolek](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lordlolek/32/906205_2.png) [@lordlolek](https://forums.unrealengine.com/u/lordlolek)\
**Post date:** [January 10, 2024, 2:47pm UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822/2 "2024-01-10T14:47:39Z")

</div>

Do you have other stuff in this widget except the single speech bubble? If not, I would rather use the Set Position in Viewport as it’s more straight forward.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/a/f3a6f003de81680d303cb568a18219af8bc23c82.png)

Also center your anchor to the middle. Generally speaking you shouldn’t move anchors to relocate widget, it’s more like a literal “anchor”, so you anchor it to a point you want it to stay relatively the same distance to, no matter what the size of the screen is.

In case of “world space” widgets I usually center them to the middle, in that case you know the center of the widget will be exactly at the world location.

---

<div class="post-metadata">

**Author:** ![TylerB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TylerB](https://forums.unrealengine.com/u/TylerB)\
**Post date:** [January 10, 2024, 5:31pm UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822/3 "2024-01-10T17:31:11Z")

</div>

That’s the thing. When I set my anchor to the middle it breaks the entire widget in the same way. I’d like to understand why that’s the case, rather than use a workaround which doesn’t expand my understanding of UMG.

---

<div class="post-metadata">

**Author:** ![TylerB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TylerB](https://forums.unrealengine.com/u/TylerB)\
**Post date:** [January 17, 2024, 5:51pm UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822/4 "2024-01-17T17:51:18Z")

</div>

For anyone having the same issue, my solution was as follows:

Use a canvas as the root so that I can offset the contents around 0,0 (using Alignment 0.5, or whatever I require)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/6/ba6a0d6b623f2679300da291d96eabff3160ceab.png)

Then when I need to, I can use Set Render Transform to offset the widget to the world posititon I want it to stick to.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/0/990743552fdae9e4db799d51b504d246cc0cf090.png)

The result is the centre of my square at the world position of my actor:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/4/6d4f3560e9782047378830184459419f10ab5108.jpeg)

Hope this helps people!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 16, 2024, 5:51pm UTC](https://forums.unrealengine.com/t/weird-anchor-behavior-when-using-set-position/1603822/5 "2024-02-16T17:51:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
