Hey everybody, I am relatively new to UE4 and I have a basic question about game mode. I have finished [this][1] great tutorial on how to make a simple game via Blueprint. As an exercise I want to remake this game via C++. My first problem is with the GameModeBase, In the mentioned tutorial, there are lots of variables within the GameMode Blueprint, variables like CurrentScore, MaxHealth and etc. And it makes sense to define these variables in a C++ class. But the problem is when I add these variables to GameModeBase
like this:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "SpaceShooterCPPGameModeBase.generated.h"
/**
*
*/
UCLASS()
class SPACESHOOTERCPP_API ASpaceShooterCPPGameModeBase : public AGameModeBase
{
GENERATED_BODY()
public:
float SpawnIntervals;
float LiveEnemies;
float MaxWaves;
float ActiveWaves;
float Score;
float CoinsEarned;
float Coins;
bool PlayerIsDead;
FVector EnemySpawnLocationMax;
FVector EnemySpawnLocationMax;
};
and go to Maps and Modes in project setting the selected GameMode is deactive:
Is there a way to specify these parameters without having to code them in GameModeBase
?
My second question is: Is there a better way of doing so? like creating a GameManager
class or something like this, and just use a simple blueprint for GameMode?