Hello,
I am having issues having my game load a different gamemode when loading a new sublevel. I looked at as much documentations and tutorials as I could however I haven’t been able to find an answer.
I have created a new gamemode the following way
UCLASS()
class TESTGAME_API ABkInvadersGameMode : public AGameMode
{
GENERATED_BODY()
virtual void Tick(float DeltaSeconds) override;
public:
ABkInvadersGameMode(const class FObjectInitializer& PCIP);
UPROPERTY(EditDefaultsOnly, BluePrintReadWrite, Category = "Game Rules")
int32 numEnemies;
};
All the cpp does is the following
ABkInvadersGameMode::ABkInvadersGameMode(const class FObjectInitializer& PCIP)
:Super(PCIP)
{
// default numEnemies
numEnemies = 1;
}
void ABkInvadersGameMode::Tick(float DeltaSeconds)
{
int i = 0;
i++;
}
After doing this I opened one of my sublevels that I load via a blueprint using load stream level
and set my gamemode level override to my newly created gamemode
However when i set a breakpoint in my gamemode, the constructor gets called as soon as the game starts, not when the gamemode is loaded and the Tick function never gets called.
I’ve tried looking as hard as I could and i am wondering: Did I setup something wrong? (probably)
does GameMode override not work with sublevels and or streaming?
Should I be doing this differently?
Thanks for the help!