How to use mouse click to change current pawn under control?

You have to iterate through all of the pawns in the world, unfortunately. You can look for subclasses and there are ways to modify your iterator to find specific classes, but in code its the only way.



for (TActorIterator<AActor> ActrItr(GetWorld()); ActrItr; ++ActrItr)
{
      ActorNameString = ActrItr->GetName();
      if (ActorNameString == something)
      {
         ContainerForPawn = ActrItr;
      }
}

Obviously, it needs more logic than this to get to your final project, but the for loop iterator I provided is a basis for what you need. More info on actor iterators is here: