Hi, I want my player to able to controll a drone. I am currently unpossing the player then spawning the drone. When I try to posses the drone it crashes. The player and drone both have seperate controllers
void ACharacter::SwitchToDrone()
{
if (DronePawnClass && isInWorld)
{
this->GetController()->UnPossess();
FVector SpawnLocation = DroneSpawnPoint->GetComponentLocation();
FRotator SpawnRotation = DroneSpawnPoint->GetComponentRotation();
TempDrone = GetWorld()->SpawnActor<ADronePawn>(DronePawnClass, SpawnLocation, SpawnRotation);
TempDrone->GetController()->Possess(TempDrone); // This crashes
}
}
Thank You