How do I assign an AI Controller to a Pawn?

I’ve created a pawn class, nothing fancy, just a mesh, with a few bones, and no animations. I’m trying to setup some Behavior tree stuff, and it sounds like I need to have an AI controller assigned to this class. Now in the defaults of this class I’ve found an “AI” category where a dropdown is that I can select my created AI controller BP. Does this assign it? The reason I’m asking is because of another post I found link text

It is said in it, that Pawns/ character classes Freeze if they do not have an AI controller assign. including physics of falling to the ground. Which basically sums up the behavior I’m getting from my spawned class. It appears when I spawn it but does not fall to the ground. If I enable psyhics in the components it starts to wiggle slowly off to one side.

Currently I’m trying to create a very basic AI for this pawn but so far all I can do is get it to spawn and then not move at all. The AI behavior is supposed to be going through the behavior Tree which I can see in the graph for it when I run the game that it’s working - or at least it’s getting all the way down the branches and into the leaf. however It doesn’t appear that my task of moving the pawn is working. I’m just guessing here as there is little documentation on this stuff that it may be do to the AI controller not being setup correctly. I’ve also tried doing the movement inside of the AI controller but still nothing.

How did you spawn the bot?

The Spawn Actor node is broken and won’t spawn the default AIController. You need to use the Spawn Default AI Controller after that is called. If you use the Spawn AI node with the BehaviorTree selected it should work fine.

Yes, setting the dropdown in the charter is what sets the AIController. If you are using a Behavior Tree you can just use the default AIController, you don’t have to extend one yourself.

There is flexibility in where you put certain functions, they can go in either the Character or Controller.

You should test it in the Event Graph and see if it is null or set with a branch and print statement. It is very likely that the tree isn’t set up correctly for the move to function as expected.

I used the Spawn Default AI, I followed your post here exactly link text
From there in my Behavior Tree I have a very simple setup. One Service, One Dec, and one BtTask in that order. The Dec is on the BtTask. In my Blackboard I have 2 keys. A bool and a vector 3. In my Service I set the BlackBoardKeySelecter to a bool, and in my Decorator I “get” that BlackBoardKey and return it into “finish condition check” as a bool. In my BtTask BP I have my instructions for the moving of the Pawn class. In this BtTask I’m using the Simple Move To Location with a temp vector three for a location. It’s coordinates are different from where the class spawns. Now, along each of the BP’s ( Ser, Dec, BtTask) I have put in some print’s to say good if they make it to the end. All of them do. Including the BtTask which is last in the Behavior Tree. I can also see the tree branches/ one leaf turn/ flicker yellow as I run the game. So it appears that a signal is going through everything to it’s end.

What I see in my scene is my Pawn Class gets spawned and sit’s several feet above the ground (where it’s coordinates tell it to spawn). At this point if it were working I would imagine that the pawn would fall to the ground as indicated in the first page I linked up top. I’ve checked my Pawn classes default’s and the extended AiController for this class is in fact referenced. I’ve tried different combinations of using different move functions as well as relocating the move task from the BtTask to my extended AI controller, and I believe I’ve even tried it in the level BP. I feel as though I’m missing one crucial bit of information that ties all of this together. Fun times…

What class is your bot extending? Pawn or Character. I’ve only used Character which provides locomotion functions, I’m not sure that Pawn does as it’s generic.

Yup, that was it. ! Drats! This whole time I was trying to do this on a Pawn and it can’t be done that way? So what is this Locomotion thing? Can pawns not be told to move around in the same way a character can? Just for my information a pawn can be moved around right? And as a general direction how would one go about doing that?

How do you assign the AI controller to the pawn?