after I change the skeletal mesh the pawn no longer animates - just goes into TPOSE but moves forward/backward, etc.
I even tried re-issuing the animation blueprint to see if that would re-start the animation… but no
am I missing something?
void AMySpawner::SpawnEnemy()
{
UWorld* World = GetWorld();
USkeletalMesh* NewMesh;
if (World)
{
AMyMonster* SpawnedMonster = World->SpawnActor<AMyMonster>(WhatToSpawn, GetActorLocation(), GetActorRotation());
NewMesh = Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), NULL, TEXT("SkeletalMesh'/Game/Monsters/FuseModel2.FuseModel2'")));
SpawnedMonster->GetMesh()->SetSkeletalMesh(NewMesh);
//tried adding the code below to see if re-issuing the animation blueprint would get the animation back - but no
UAnimBlueprint* AnimBP = Cast<UAnimBlueprint>(StaticLoadObject(UAnimBlueprint::StaticClass(), NULL, TEXT("AnimBlueprint'/Game/Monsters/Zombie_animationBP.Zombie_animationBP'")));
if (AnimBP)
{
SpawnedMonster->GetMesh()->SetAnimInstanceClass(AnimBP->GeneratedClass);
}
}
}