Download

Controlling Ai Character

So, I’ve been wondering, if you can control an Ai character. Like literally control an Ai Character, if you’re in the Ai trigger box and by pressing a button, you can control that Ai and move with it. I’ve been searching related to this topic but couldn’t find one for hours. So… is the idea of controlling an Ai and move with it by using Blueprint workable? If so, where do I start doing it? If not, Rip.

Hey, do you mean you have an AI that runs around by itself until you decide to play that Character by yourself?

If yes, then you want to check out what Controllers are. You, by default, have a PlayerController. That’s basically what identifies you in the game and what gets your key presses into the game (not directly, but let’s keep it like this).

The AI on the other hand uses a so called “AIController”. They are both children from a basic “AController”. Controllers can possess Pawns and Characters (child of pawn).
So the AI Character is possessed by the AIController. If you want to control it, you need to call “Possess” on it with your PlayerController.

I’m sure you can find plenty of stuff if you search for the words above. They are really basic and it’s important that you read UE4’s documentation and other tutorials involving them.

PS: Make sure to define the Inputs INSIDE of that AICharacter. So as soon as you possess it, you are able to use the Inputs of it. (Comes with the possession and is part of how Input is processed)

Ohhh, I get it. Thank you for replying my question!