4.5.1 umg get game instance crashes editor

Create a widget. Add a button, in this button try to get your custom game instance and set some variables. Save your widget - close editor, open it again. After opening editor again try to open your widget - you will get crash.

Hello

When you say “get your custom game instance and set some variables”, could you be a little more specific? Could provide screen shots of your widget to make sure that we are producing the same issue? Any additional information will help narrow down the issue that you are experiencing.

It’s hard for me to post a screens because if something isn’t working I’m changing a lot :stuck_out_tongue:

Create custom game instance class, add a int variable there.
Create widget blueprint with button, on button click cast to your custom game instance class and set the int variable in custom game instance class. Open the game, click on the button couple of times - do whatever you like :slight_smile: Close the editor, open it again, and try to open your widget - you should get crash about bad access when trying to get game instance.

Hope this helps! I’ve managed to resolve the issue by casting to game instance from player controller which is owning widget.

Hello

I was unable to reproduce the issue. If it happens again with another setup please take a screen shot and send it to us for closer inspection. Thanks for your information and time. If you have any additional information I will look into it further. Otherwise since you have resolved the issue I am going to mark this as closed.

Make it a great day