How do I make gamemode properties editable using c++ only?

I’m still just learning the basics and I’m wondering what I have to do in order to make gamemode properties in my derived gamemode-class editable in the UE editor. Right now they are all greyed out under project settings and I want to be able to change the default pawn there.

My guess is that I need to use UPROPERY somehow, but since I am not declaring new variables (already existing in parent class), I wouldn’t know how.

Bump. I’d still like to know this, so I can pick another standard-player on the fly without having to recompile the whole thing…

Hello,

Have you tried to create a blueprint based on your Game Mode c++ class and then edit those properties there? If this is not what you’d like to do, could you provide a bit more explanation on exactly what it is you’d like to achieve? Thank you.

Well it’s not that big of an issue. It’s just that, when you create a C++ class and use UPROPERTY, you can edit those variables in the Unreal Editor. Why can’t I do the same with a game mode under project settings >> maps & modes?

The easiest way to be able to set these values is to create that blueprint based on your game mode class and set the values there. Just ensure that you set the newly-created blueprint game mode as your default in Maps & Modes.

As far as being able to set these in code, you can have a look at this wiki page which contains information on how to go about doing this: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
The page is out-of-date, but it should give you a good starting point if you’d like to set those in code.

Hello,

There is documentation available that shows you the basic idea of how to link the player controller and other things in the Game Mode through code: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

Other than this, I recommend creating a Blueprint based on your Game Mode C++ class, which you can then use to edit these values such as Default Pawn, Player Controller, and so on.

Have a great day,

Sean Flint

I have the same question. I create a GameMode in C++. However, when I view this GameMode in the Maps & Modes view, or in the Level Override view, I cannot change the classes configured on the GameMode. How do I re-export these variables so they are BluePrint editable?
I can create a BluePrint subclass of my C++ class, which then has the properties editable. But what magic is happening that makes it so?