The OnUnPossess() method of the AAIController class is triggered twice
virtual void OnUnPossess() override;
void AMyGameAIController::OnUnPossess()
{
Super::OnUnPossess();
UE_LOG(LogTemp, Warning, TEXT("AGameAIController::OnUnPossess()"));
}
5. Compile.
6. In the editor, create a Pawn and assign its controller to MyGameAIController
7. Open the Level Blueprint, Drag an instance of Pawn from the persistent level into the level Blueprint.
8. Drag off the Pawn node and type and select "Destroy Actor" to create a destroy actor node.
9. Right click on the Event Graph and select input key F event.
10. Connect the Execution pin from the Input Key F event into the Destroy actor call from the pawn.
11. Press PIE, call the logic in the level by pressing F. Observe the Output log.
Result:
OnUnPossess() is triggered twice.
Expected:
OnUnPossess() to be triggered once.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-92282 in the post.