I have 2 3rd person characters, I first gave them AIContoller, I want to realize that when another character is clicked, that character is controlled by Player 0, and the other character continues to be controlled by AI. switch between each other.
The problem now is that after controlling the character and switching to another character, the liberated character does not return to the original AI control.
The blueprint below is written in the third person character Pawn BP.
I currently have 3 third person templates. Your solution doesn’t work very well. The current situation is that when the first click is made, all 3 AIs are taken over by the player and stop moving. And when I click the second time, the previous one will be released, but the Pawn controlled by the player and another Pawn are still not controlled by AI. That is to say:
The first time, one Pawn is controlled, and the remaining 2 will stop without any AI or player control.
The second time, the last Pawn controlled by the player becomes AI, the player controls one Pawn, and the third Pawn still has no control.
“SelfAIController” is what I got and added in Event BeginPlay. Other than that there is no other code.