4.11 Widget component renders incorrectly in screen space with possessed CameraActor

Following [this tutorial - Using a Static Camera][1] and possessing a CameraActor placed into the level, seen in the blueprint below:

https://docs.unrealengine.com/latest/images/Gameplay/HowTo/UsingCameras/Blueprints/camera_bp9.jpg

Any widget components on other actors (when set to render in screen space) are offset - left: screen space - right: world space.

85029-capture.png

The screen space rendering is fine (centered) if you possess a Pawn containing a single camera using a custom game mode and player spawn.

85030-capture1.png

Hello fpwong,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. If you turn off the setting “Constrain to aspect Ratio” for the new camera does this issue still occur?

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 :slight_smile:

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.

Make it a great day

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.

In my case, turning on / off didn’t help. =(

Tested on UE 4.11.1

Hello,

Could you answer the original questions that were asked of fpwong so that I can get a better idea of what issue it is that you are experiencing?

I’m having the same issue describe here. Here are my answers:

  1. Yes, I am able to reproduce on a clean project using 4.11.1.

  2. 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.
  1. If I set Constrain Aspect Ratio to false on the CameraActor instance in my level, the issue is resolved.

Hello vanzeipel,

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.

Make it a great day

Hi! I recently updated my project to 4.12.2 and the issue is still there. Is there any news regarding this fix?
Thanks!

Hello,

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.

Make it a great day

Unreal Engine Issues and Bug Tracker (UE-29637) It is marked as Fixed in 4.13, currently I’m using 4.14 and the bug is still there.

Hello lxSTONExl,

Can you reproduce this issue in a clean project? If so, could you provide a detailed list of steps to reproduce this issue on our end?

Hello Rudy,

I tried in a clean project and the problem persist.

  1. Create a new blueprint class with a widget component, set a random widget just to display something and set the “Space” value to “Screen”.
  2. In your player camera set “Contrain Apect Ratio” to TRUE, and force the aspect ratio to something.
  3. 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 checked 4.13 and actually the problem is fixed, but in 4.14 is broken again.

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.

Make it a great day

Thank you too for you patience.

Still seems to be around in 4.15