Widget Get Owning Player not working with non trivial widget config
I have an issue with moving around in a simple menu. I had a more complex project and pulled the broken parts into a very simplified base project so that the bug can clearly be seen. This means, all the menu game logic is stubbed out as print statements, so there should be no external dependencies on this bug repro-ing.
The issue is that the "get owning player" function for widgets returns an invalid reference to the player controller. One could get around this by simply getting the player controller for player 0. But that solution will not work for all use cases. When I was trying to repro it, a simpler UI did not repro the bug, so I worry it may be a race condition, but I don't know/didn't look deeper.
To repro with this project follow these steps
This should error out the UI and give a blank screen with an error message that reads: "LogScript: Warning: UGameplayStatics::SpawnObject null outer LogScript: Warning: Accessed None trying to read property CallFunc_SpawnObject_ReturnValue HostSessionMenu_C /Game/UEDPIE_0_Menu.Menu:PersistentLevel.PlayerController_0.HostSessionMenu_C_0 Function /Game/Blueprints/HostSessionMenu.HostSessionMenu_C:ExecuteUbergraph_HostSessionMenu:00D3"
Another repro method that works is: 1. Launch the menu map (should be default). 2. Click the join button. 3. Click the back button. 4. Click the join button again.
The join menu's back button gets the player controller by player index instead of querying the widget owner which is why it works, but when we go back to the original menu, it's buttons become broken because that menu uses "get owning player" (which means get owning player works at game launch for that menu and then breaks later on in the same run).
Project Dropbox link. https://www.dropbox.com/s/p96kt7qtz5j24ib/WidgetTest.zip?dl=0
Public Github for project https://github.com/erebuswolf/WidgetTest
If there is something I'm doing wrong with this menu creation please let me know, but I cannot find anything going on that makes sense for why this doesn't work.
asked May 17 '18 at 02:26 AM in Bug Reports
Follow this question
Once you sign in you will be able to subscribe for any updates here