In “Handling Pawn Death”, we insert this code into our ToonTanksGameMode.cpp
function:
if (Tank->GetTankPlayerController())
{
Tank->DisableInput(Tank->GetTankPlayerController());
Tank->GetTankPlayerController()->bShowMouseCursor = false;
}
Is there any particular reason we didn’t place this code in the HandleDestruction
function? To me it makes more sense, since that code involves rendering the tank inaccessible to the player:
Super::HandleDestruction();
SetActorHiddenInGame(true);
SetActorTickEnabled(false);
//Below code was in "ToonTanksGameMode.cpp"
if (GetTankPlayerController())
{
DisableInput(GetTankPlayerController());
GetTankPlayerController()->bShowMouseCursor = false;
}