Hi all, how do I convert an ACharacter to an AActor? SetViewTarget only accepts AActor but I have a ACharacters. I thought they should be able to work?
;
void UUHRIGameInstance::SwitchCam()
{
TArray<ACharacter*> Rovers;
UWorld* World = ();
for (TActorIterator<ACharacter> ActorItr(()); ActorItr; ++ActorItr)
{
Rovers.Emplace(*ActorItr);
RoverSize++;
}
APlayerController* Controller = UGameplayStatics::GetPlayerController(this, 0);
if (Controller)
{
Controller->SetViewTarget(Rovers[CamIndex]); //error here
if (CamIndex > RoverSize)
{
CamIndex = 0;
}
else
{
++CamIndex;
}
}
}