I’m trying to use this starter tutorial to learn about Unreal; Well, I’m already stuck in the first part (haha) which I just need to print a message.
The code is written as the tutorial say so:
MyGameMode.h :
UCLASS()
class AMyGameMode : public AGameMode
{
GENERATED_UCLASS_BODY()
virtual void BeginPlay() override;
};
MyGameMode.cpp:
AMyGameMode::AMyGameMode(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
void AMyGameMode::BeginPlay()
{
Super::BeginPlay();
StartMatch();
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("SURVIVE"));
}
}
Also, my unreal version is 4.1; What possibly I could be missing here?
thanks in advance
hello, did you set it up as the level default game mode/ game default game mode?
hmm, code seems fine to me, at first i thought it may have been a function mis-match (UE4 function names seem to change alot) but if it compiles that isnt the issue. can you start the game then eject(Shift +f1 i think is the key) and search in the scene outliner for the AMyGameMode class?
I’ve noticed I couldn’t see it before you say, which means probably it isn’t being called/initialized, right?
can you click on the ‘world settings’ tab within your game level and type ‘game mode’ into the world window search box, make sure the game mode override is set to your ‘AMyGameMode’ class. this tells the level that is the gamemode you want, hopefully that should do it
You are right, I jumped this step somehow =/ noob failure haha post it as an answer thus I can accept - thank you
click on the ‘world settings’ tab within your game level and type ‘game mode’ into the world window search box, make sure the game mode override is set to your ‘AMyGameMode’ class. this tells the level that is the gamemode you want, hopefully that should do it. Glad i could help 