Hi, I have a simple C++ project based on the ThirdPerson template, everything work fine. But I tried to change the Character into a MixamoAnimPack character that I downloaded from the marketplace, the character can be loaded and move around with animation via W, S, A, D keys, but it can’t be fully possessed by the player controller. for example, the collection sphere is not attached to the new character, and certain keyboard inputs don’t work. Any suggestions and help please ?
I have also tried following code in my GameMode class as follows, but it seems did nothing to allow the player controller to posses the new character.
AMyProjectGameMode::AMyProjectGameMode()
{
// set default pawn class to our Blueprinted character
static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT(“/Game/MixamoAnimPack/Mixamo_Kachujin/Mixamo_Kachujin”));
if (PlayerPawnBPClass.Class != NULL)
{
DefaultPawnClass = PlayerPawnBPClass.Class;
}
}
void AMyProjectGameMode::BeginPlay()
{
Super::BeginPlay();
// Set score to beat
AMyProjectCharacter* MyCharacter = Cast<AMyProjectCharacter>(UGameplayStatics::GetPlayerPawn(this, 0));
for (FConstPlayerControllerIterator It = GetWorld()->GetPlayerControllerIterator(); It; It++)
{
APawn* MyPawn = Cast<APawn>(DefaultPawnClass);
MyPlayerController = Cast<APlayerController>(*It);
if (MyPlayerController && MyPlayerController->IsLocalController())
{
MyPlayerController->Possess(MyPawn);
}
}
}
Thanks in advance