

Behavior Tree: This graph is where you will create nodes to make the behavior tree.The behavior tree editor contains two new panels: Navigate to Characters\Muffin\AI and select Add New\Artificial Intelligence\Behavior Tree. Now, you will create the logic that will drive the muffin’s behavior. This will make sure AIC_Muffin automatically possesses BP_Muffin when spawned. Since you are spawning the muffins, you also need to set Auto Possess AI to Spawned. This will spawn an instance of the controller when the muffin spawns. Go to the Details panel and locate the Pawn section. If it doesn’t, click Class Defaults in the Toolbar. Navigate to Characters\Muffin\Blueprints and open BP_Muffin.īy default, the Details panel should show the default settings for the Blueprint. Next, you need to tell the muffin to use your new AI controller. Select AIController as the parent class and name it AIC_Muffin. Navigate to Characters\Muffin\AI and create a new Blueprint Class. To control the muffins using AI, you need to create a special type of controller known as an AI controller. In the case of AI, the Pawn can receive information from the controller or brain (depending on how you program it). The controller could also handle the inputs instead and then tell the Pawn to perform an action. The controller receives inputs from the player and then it can send the inputs to the Pawn. But what does ‘control’ mean in this context?įor a player, this means pressing a button and having the Pawn do something. Possession allows the controller to-you guessed it- control the Pawn.

What is a Controller?Ī controller is a non-physical actor that can possess a Pawn. First, you will create a controller which will be the soul. Since you already have the body, all you need is a soul and brain. You can create this in different ways such as C++ code, Blueprints or behavior trees. Brain: The brain is how the AI makes decisions.Soul: The soul is the entity controlling the character.Body: This is the physical representation of the character.To create an AI character, you need three things: When an enemy muffin comes into the AI’s range of vision, the AI will move to the enemy and attack it. In this tutorial, you will create an AI that will wander around. Left-click within the fenced area to spawn a muffin. Navigate to the project folder and open MuffinWar.uproject. Part 9: Getting Started With AI (you are here!)ĭownload the starter project and unzip it.
UNREAL ENGINE 4 TUTORIALS SERIES
Note: This tutorial is part of a 10-part tutorial series on Unreal Engine:
