4.7.5 gamemode always reset default pawn class

It’s a c++ third person template project, c++ GameMode set default pawn class to ThirdPersonCharacter, and a blueprint class BP_GameMode inherit from it. but default pawn class value reseted every time project load.

i have a [similar problem][1] with BP_GameMode, resolved by move some code to other bp class, but it’s strange.

39393-cc.png

Hey -

I just want to clarify that the Game mode is a C++ class and the default pawn is setup inside the code class as well, is that correct? Also, could you post the code used to setup/create the default pawn inside the class?

Cheers

Hey ,

Thanks for your replay.
1, the problem in my BP_GameMode.
2, BP_GameMode inherit from c++ class AXXXGameMode.
3, AXXXGameMode i have not change any thing since it created by project . here is full source code:

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#include "XXX.h"
#include "XXXGameMode.h"
#include "XXXCharacter.h"

AXXXGameMode::AXXXGameMode(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	// set default pawn class to our Blueprinted character
	static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/ThirdPerson/Blueprints/ThirdPersonCharacter"));
	if (PlayerPawnBPClass.Class != NULL)
	{
		DefaultPawnClass = PlayerPawnBPClass.Class;
	}
}

it works well early, but after last problem it start to reset default pawn class value. sorry that i forgot what i have do with it…

Cheers

and if i click the yellow reset icon, the default pawn class will reset to ThirdPersonCharacter, the default value is inherit from it’s parent c++ class AXXXGameMode.
it seems some thing changed it after load this file, that is really strange~~~

Hey -

When the default pawn class is reset to default pawn, does the GameMode Override selection also return to default or does it remain as the BP of your game mode class?

Hi ,

Sorry i forgot to explain this, game mode is still BP_GameMode, just default pawn class and hud class has reset mark. default pawn class has reset to default pawn, hud class still c++ class MyHUD but has reset mark. default game state has no reset mark.

reset mark i means the yellow icon behind value changed variable, click it can reset/cancel change.

and if i change default pawn class from game mode class default settings or world settings or project map and modes settings, other two settings will update too. it seems all three place reference the same data source: current gamemode’s value.

Cheers

Hey -

Sorry for the continual questions, but what you’re describing sounds like a known bug with C++ class / blueprint behavior when closing/opening the editor (UE-13842). This is currently under investigation and should be fixed in a future update.

Cheers

Hey , I’m having the same issue, are there any known workarounds at the moment?

Hey and Hitsugen,

I am very happy to tell you i have solved this problem. just reparent BP_GameLogic to GameLogic, editor will warning you this may lose data, click yes.

Ofcourse, i can reparent because it’s old parent class XXGameMode is nothing, so reparent to GameMode will not lose any data, and i have backup whole project…

Cheers