Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Widget overflow the screen when created


I'm creating a widget on mouse cursors position. However, when mouse is too right or left, It is created outside of the screen. How can I fix that? Thank You

alt text alt text alt text

Product Version: UE 4.16
new_cap1.png (708.7 kB)
new_cap2.png (275.7 kB)
new_cap3.png (51.1 kB)
more ▼

asked Jun 13 '17 at 11:19 AM in Blueprint Scripting

avatar image

3 1 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


Because it creates the widget at the top left corner of the canvas. First you should attach your widget component to the anchor (place it to the top left of the canvas). Here take a look at the following images;

CORRECT ! alt text

WRONG ! alt text


Follow my setup and your widget will no longer exceed the view port limits.

Widget Designer (please follow my exact widget setup) alt text

HUD event graph alt text

I hope it's self explanatory XD.


correct.png (41.8 kB)
wrong.png (42.5 kB)
hud event graph.png (458.0 kB)
more ▼

answered Jun 13 '17 at 01:20 PM

avatar image

1k 29 14 46

avatar image emreonder Jun 13 '17 at 01:38 PM


I solved the problem but now the problem is that It is created whether mouse is close enough to viewport limits. I want that widget is created enough left or right position so that It is seen even mouse is clicked when close enough to Viewport limits.


avatar image navid100 Jun 13 '17 at 07:18 PM

I have updated the answer. I'm so tired to explain what I did, please figure it out by yourself ;D

avatar image emreonder Jun 13 '17 at 07:39 PM

I understand what you are trying to do. I have just one question. I have 6 button inside a canvas. How can I do that anchor thing in canvas? Do I need to do it for every button in canvas? :D THANK YOU!

avatar image navid100 Jun 13 '17 at 08:16 PM

No, Add a wrap box and attach all your buttons to it, then just use the wrap box size for the view port.

avatar image emreonder Jun 14 '17 at 09:52 AM

I updated my question. Can you please check that?

avatar image navid100 Jun 14 '17 at 11:26 AM

You have totally changed the question :D.

I couldn't read the size of a wrap box from BPs, Try to read those values (widget width & widget height) manually. Just like how I did. Besides, a wrap box is just a holder, even getting its size from a BP, or set its size, won't affect its children.

One thing to note is that, the setup I created inside the HUD (the one you followed) is one way of solving this issue. In fact I tried to convert the Canvas screen space into view port screen space. (that's why I have multiplied the widget width and height by view port scale factor). There is another way in which you can do whole the thing inside Canvas screen space (convert view port space into canvas). The reason I chose the first transform, is that I found it simpler.

avatar image emreonder Jun 14 '17 at 11:54 AM

It worked but now I don't know why but I can't move my player or look around. I was creating functions inside level blueprint. Am I doing wrong?

avatar image navid100 Jun 14 '17 at 12:12 PM

Check your player controller settings (movement controller events). It has nothing to do with the level BP, you may have changed something related to your character controller settings.

avatar image navid100 Jun 14 '17 at 12:28 PM

If it solved your problem, please mark the question as resolved. This link should help you.


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question