Tutorial: Your First Game In Unreal Engine 5

Here are those two functions in C++

bool APawn::IsPlayerControlled() const
{
	return PlayerState && !PlayerState->IsABot();
}

bool APawn::IsBotControlled() const
{
	return PlayerState && PlayerState->IsABot();
}

I’m not exactly sure what sets IsABot but that doesn’t matter in this case because our AI controlled bot doesn’t even have a PlayerState so IsBotControlled() always returns false for it.