I’ve been trying to spawn a subclass of an animation instance. Basically, I have an animation blueprint derived from AnimInstance that I have assigned to my Bot:
.h
UPROPERTY(EditAnywhere, Category = "SpawnManager")
TSubclassOf<UAnimInstance> BotBP;
And I have tried different methods of spawning it, using the BotBP, the ClassWithin too, and other derivations.
Using the below to spawn BotBP the log reports anim_bp_C is not an actor class:
if (BotBP)
{
FActorSpawnParameters spawnParams;
spawnParams.Owner = this;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FVector spawnLocation = FVector(500.0f, 170.0f, 170.0f);
FRotator spawnRotation = FRotator::ZeroRotator;
ASkeletalMeshActor* bot = GetWorld()->SpawnActor<ASkeletalMeshActor>(BotBP, spawnLocation, spawnRotation, spawnParams);
:
}
And if I change the SpawnActor call to use the ClassWithin the log reports SkeletalMeshComponent is not an actor class:
GetWorld()->SpawnActor<ASkeletalMeshActor>(BotBP->ClassWithin, spawnLocation, spawnRotation, spawnParams);
Any help would be appreciated it.
Thank you.