Accessing GameState(written in C++) variables and functions in Blueprints?

So I have my GameState setup in C++, and I’ve declared a variable to hold the number of players in the server, along with its Getter and Setter, and I’ve marked both as BlueprintCallable. I want to access this Getter and Setter from a BP, but whenever I do “Get Game State” and “cast to my Game State”, I don’t see either of these show up in the BPs. I’ve done this countless number of times with other C++ classes, and I’m not sure why it doesn’t show up for Game State or Game Mode classes? Any insights on this would be greatly appreciated. Is this not allowed, and if so, why ?

Thanks

Make sure you have that custom gamestate class set in the GameMode you have set in your Project or Level settings.

It is, but it still doesn’t show the functions and variables. Here is the declaration in PGameState.h class, it has been defined in PGameState.cpp too

It is configured properly in the Project settings:

But I can’t access them in the BPs:

nope. even the category doesn’t show up

Does the Server Settings category show up when you drag the pin, before you type anything?
Maybe @anonymous_user_f5a50610 can help.

It should work normally without issue there no blocks like that and blueprint in reality don’t know any roles of classes, it job is just executing code whatever it is.

I notice other issue and i wonder why you not getting compilation errors or at least warnings aspecially from UHT, potentially pointing the issue. Reflection system does not support int type and that time should not be used in UE4 code as int does not have fixed size on all platforms and compilers, in ue4 you should use explicit fixed sized int types like int32 or uint8 (only those 2 types are supported by blueprint system, but other int times are compatible with reflection system and property editor)

First of all close editor before compilation which make sure hot reload is not on the way (it sometiems mess ups when you add new declerations), then click rebuild instead of build which will force UHT to read all header files again. It is UHT job to catch BlueprintCallable function and register them in generated code so blueprint editor could see them.

Thanks for the response Shadowdriver!
I have tried all of the things you mentioned. I was initially using uint8 itself, but I changed it to int later when I started running out of ideas, and to eliminate the type being a reason. I’ll revert it back to uint8 although I’m not sure why that would be of problem because I have used int in C++ code and referenced it in the BPs before and it worked.
I also restarted the editor to check if it was a hot reload issue, and I also did a full rebuild, but it still behaved the same.
I guess it could be a bug?
I just wanted to make sure that it is indeed allowed by UE4 to do this in the GameMode and GameState classes? Since I’ve done this at other places and it’s not happening here (in GM and GS), the only thing I can think of right now is that maybe these classes have different behavior than other regular classes?