InputMappingContext UPROPERTY from GameMode?

I have been experimenting with Enhanced Input plugin and ran into a very curious case. I try to define UPROPERTY(ies) in my custom GameMode for a an InputMappingContext (and ideally a TArray of them), because I want the game mode to decide which mapping context to grant to the player. The bizarre thing is I define the UPROPERTY (EditDefaultsOnly, BlueprintReadOnly) in my gamemode’s native C++ class, but it doesn’t show up in the blueprint details panel. I have created other properties for other stuff (whether more primitive types or other classes like widgets etc.) succcessfully but I can’t get anything to show up in my game mode’s BP for me to pick. I wonder if it’s a bug… or (more likely) I’m missing something very obvious here to make it work!

1 Like

My own update: I discovered that the culprit was the Category I was using for the UPROPERTY! Apparently ‘Input’ does NOT work :smiley:

Trying any other more custom name works fine, I can see the property I create. Must be that perhaps GameMode does not allow Input as a named category? Or perhaps there is one by default already but it’s hidden. Need to check in the declarations of the AGameModeBase perhaps…

1 Like

My own update #2: Yes! Confirmed, AGameModeBase’s parent class, AInfo, hides the ‘Input’ category by default in its declaration metatags. One has to do ShowCategories again to include it back. I hope this helps anyone else after me with similar problems.

1 Like