Set default pawn in gamemode

anonymous_user_4116411d
Tue, 30 Oct 2018 19:27:40 +0000
Platform & Builds

i noticed that the projects that come with unreal use this piece of code to set the default pawn

static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/folder/name"));
	if (PlayerPawnBPClass.Class != NULL)
	{
		DefaultPawnClass = PlayerPawnBPClass.Class;
	}

but i found that others use this instead

DefaultPawnClass = AMyChar::StaticClass();

is any of these options better than the other?

2 posts - 1 participant