Widget Creation can easily go wrong


Making the Widgets themselves were fine. I had no problems there. Coding functions for the different elements in the widget that needs them were also fine, though with a few bugs that we learned of through testing and fixed. The biggest issue was learning more on how to add and remove the widgets from the screen. Most of the problems were that we couldn't get the Player Controller to be able to use to put the widget on screen. We tried manually adding it, but that would crash the game. I would step through the code, 1 line at a time, seeing that the player didn't have a player controller, or if it did, it will still fail.

Turns out we were setting the player up incorrectly. In the gamemode, we set the Player Controller, but just had the player actor set in the world. What we had to change was that we had to remove the player actor from the world and set it in the gamemode as a Default Pawn. After setting that, everything just started working. For multiple hours, I thought it was an issue with the widget itself, then the player controller not being initialized, and then finally found out that I was entirely wrong and that the fix was extremely simple.

Leave a comment

Log in with itch.io to leave a comment.