Accessed none trying to read property GameInstance

So sorry for asking this but I’m a very very new dev and I am still having a hard time with UE4.
As shown in the picture,


I have a save game component with save loading function. Normally, when I call the Load Save custom event from a widget, it works perfectly fine without a problem. However, when I try creating a custom function from a separate blueprint function library, one of the nodes shows that I need world context reference. And if I leave it empty, the errors above shows up.
So my best educated guess is that I have to link the world context to something, but after countless trials, I can’t seems to find out what it is.
Thanks in advance for your help !

I literally had the same problem a few days ago until I was shown the error of my ways which was a dumb mistake. You can view the whole answer here:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1794505-a-little-issue-i-m-having-with-saving-loading-the-game

Essentially you most likely forgot to set the save game variable after casting it so it can’t get reference to it anywhere else.

After setting the reference to both load and save custom event, I got this error when running the custom function:


I honestly have no idea what is going on…

If someone else is having the same problem for me it worked just deleting all the saved games from Project/Saved/SaveGames folder :ok_hand:t2::ok_hand:t2::ok_hand:t2:

Thanks a lot!! You save me a entire day!

Hello everyone. I was having this warning for SaveGameInstance. what fixed for me was very simple change actually. In project settings search for game instance and make sure you have your SaveGameInstance selected in the check box. This worked for me hopefully it works for you as well