Hmm, I’ve opened the project used to test and take screenshots and the bug was gone. Also tried recreating it like I did yesterday in another blank project and it seems fine. Guess turning it on / off fixed it, unless this was hot-patched already
I am happy to hear that your issue has been resolved. I will be marking your last comment as the answer for this issue. If the issue returns please feel free to reopen this issue with a reply containing any additional information that you may have.
Hi! I’m facing the same issue in my project… I found out that if the viewport size matches the camera aspect ratio (i.e. 1280x720 window and a 16:9 camera) them the screen space widget align perfectly, but if the viewport is wider or taller (i.e. 1024x768 window and 16:9 camera) the widget is offset to the right or down. This doesn’t happen when using world space.
I’m having the same issue describe here. Here are my answers:
Yes, I am able to reproduce on a clean project using 4.11.1.
I created a new C++ project, empty.
I created two new blueprints, one a widget blueprint named “WidgetTest” and one an actor named “WidgetTestActor”.
In WidgetTest, I added a static text widget as a child of the canvas panel slot. I set the anchors to 0.5 (for both min/max width and height), a position of 0 for X and Y, and Size to Content checked, making the text “Sphere” show up in the middle of the anchor point. Compiled the saved the blueprint.
In WidgetTestActor, I added a sphere component at 0,0,0 and a child of the DefaultSceenRoot. I added a widget component as a child of the DefaultSceneRoot and set its position to 0, 0, 60cm, so that it will display the widget with the text “Sphere” above the sphere component (as you see in the correct screenshot below). In the widget component, I set the space to “Screen” and the widget class to the WidgetTest blueprint I created earlier. I left draw size at 500x500 and Pivot at 0.5, 0.5. Compiled and saved the blueprint.
In the level, I dragged in an instance of my WidgetTestActor blueprint and set its position to 240cm, 0, 120cm. I dragged in an instance of CameraActor and set its position to 0, 0, 120cm. I left all other settings on the camera unchanged (Contrain Aspect Ratio was checked by default).
In the level blueprint, I call Set View Target with Blend off of the Event BeginPlay node and set “CameraActor” to be the New View Target.
Play my level in the editor and the widget is incorrectly positioned.
If I set Constrain Aspect Ratio to false on the CameraActor instance in my level, the issue is resolved.
I was able to reproduce this issue on our end. I have written up a report (UE-29637) and I have submitted to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.
I went ahead and double checked on this issue for you and it appears that this issue’s status has not yet been updated to fixed. However, I will be sure to bump up the community interest for this issue.
I tried in a clean project and the problem persist.
Create a new blueprint class with a widget component, set a random widget just to display something and set the “Space” value to “Screen”.
In your player camera set “Contrain Apect Ratio” to TRUE, and force the aspect ratio to something.
Now play in viewport/standalone and try to resize the window/viewport, black bars should appears, but the widget component will be rendered in a wrong position.
I was able to reproduce this issue in 4.14 using the original steps in the report above. I have reopened the issue for further investigation. Thank you for your time and information.