I’ve just converted my project from 4.15 and I’ve got a somewhat annoying problem. As the title says, I can’t access any Gameplay Statics (game instance, character players, etc.) from global functions. It returns null every time. It returns null on other occasions too, basically every time the “World Context Object” node appears, the instances will return null.
A workaround is to use macro libraries instead, but the changes would take a great amount of time. I’d like to know if it’s really a bug, and will be fixed, or it’s intended.
What mode are you in when the World Context node returns null? Using the setup in the screenshot below, I noticed my “Is Not Valid” branch being triggered only in a standalone game. PIE and a packaged game both produced the result from the Is Valid branch. Can you confirm if this is the same behavior you’re having?
Alright, I’ve messed around more with the problem, and re-compiling does not always fix the problem. The behavior is absolutely erratic. Here are the multiple findings I have at the moment.
Most of the time, anything in a Blueprint Function Library that has the “World Context Object” node fails and returns null in PIE.
Re-compiling an animation blueprint that calls a function from a Blueprint Function Library fixes the problem everytime
Re-compiling the Blueprint Function Library does not fix the problem.
After re-compiling/testing some specific actors, the problem fixed itself, the reason is unknown.
I thought this was a conversion problem from 4.15 to 4.17, but I created an empty project reproducing the same calls, converted it, and there is no problem.
Calling GetGameInstance from an Actor Macro Library works fine, and so does calling it directly in the blueprint.
The same problems occur with Actor Components.
Creating a new Blueprint Function Library and accessing the Gameplay Statics works fine. Only the old ones from 4.15 returns null.
That pretty much sums it up. I started to refactor some of the project’s code, but quickly realized that a refactor is not a viable solution, it would take me weeks to refactor everything as I relied heavily on Blueprint Function Library for tools like finding specific actors, accessing GameplayStatics, Save instances, managing widget creation, etc.
We’re going back to 4.15. I would appreciate any help as there are features in 4.16 and 4.17 alike that we’d love to have.
I am also getting this issue since moving to 4.17 from 4.16. I use a simple library to get a volume value from the game instance. It’s a bit hit and miss, some classes calling it works & some return the context null error.
It appears that “Change 3499420 by .Noland” may have caused it. He changed the way context works.
Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-49567) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
I have a project that I upgraded to 4.17 from 4.16 this morning and anything with a World context reference inside a function library returns none. Yay. Recompiling didn’t seem to help.
I’ll play around with it a bit see if i can get ti to work but I’ll probably stick to 4.16 (which in itself is annoying as there are bugs in that that are fixed in 4.17). But right now the 4.16 bugs are not breaking the game.