I have a widget which in one of the bound functions calls GetPlayerController. I have previously had this HUD added to the screen (which worked) but I tried adding it to a WidgetComponent. As soon as I do this, the editor crashes:
Access violation inside UGameplayStatics::GetPlayerController on line 38 (presumably now world [or no WorldContextObject])
This question seem related, but haven’t been resolved:
Crash when spawning Actor with WidgetComponent
Hello ,
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:
- What version of the engine are you using?
- Can you reproduce this in a clean project?
- If so, could you provide a detailed list of steps to reproduce this issue on our end?
- Can you clarify to what actor it is that you are adding a widget comment to?
Hello ,
I was able to reproduce this issue on our end in 4.6. However, after running the same test in 4.7.2 I have found that this issue has been fixed. Thank you for your time and information.
Make it a great day
Could you point me towards a commit that fixes it so I can integrate that in to our engine (we are not currently looking to upgrade to 4.7)
Hello ,
I believe that this is the commit that you would be looking for. I hope that this helps.
https://github.com/EpicGames/UnrealEngine/commit/48d435dfd39971d3c6f4f4c254551f8e93aac403
Make it a great day