[4.17] Get player controller not working inside of functions

I recently upgraded to 4.17 and found that any functions I had (which were working as expected in 4.16.3 and earlier) which contained a “get player controller” function no longer work. The instances in which I was using these were for creating widgets and assigning the owning player, and I was getting the error “Unable to create the widget X, no outer provided.”

Creating an input for the world context object seems to be a workaround.

Hello nickjborn,

I was unable to reproduce this issue on our end. 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 in a clean project?
  3. Could you provide screen shots of any settings/blueprints/widgets that may be involved with this issue?

I am encountering this issue in UE 4.19.0 I made a clean project and am doing simple menu creation and the get owner function always returns invalid so I have to always get the player controller directly.

Hello nickjborn,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

Thanks

I had the same problem. It turns out the Construct blueprint function should not be used for creating widgets. Instead use the “Create Widget” function. This will set the owning player correctly and avoid this bug.