Hi,
We’ve been following the [behavior tree quick start tutorial][1], but we’ve been running into an issue.
We’ve got an “enemy” blueprint that has the capsule component and all the other parts that we want in an enemy that follows the player around.
The Imp[Suffix] things are different flipbooks used to represent different perspectives from which the player observes the enemy character. This is made to achieve a doom-like sprite system. Enemy_Blueprint contains the blueprint scripting necessary to make the flipbook change depending on the player’s view (none of this changes the orientation of the actual capsule), and it also has a rudimentary health mechanic.
Now, on to the issue: you’ll notice that in the “pawn” category on the right of that image, the Auto Possess AI option is set to “Placed in World or Spawned”, and the AI Controller Class is set to “Follower_AI_CON”. Follower_AI_CON is close to Follower_AI_CON in the quick start tutorial linked above ([this][3]). There are two differences.
- Instead of event beginplay starting the execution, it’s event onpossess. This was something suggested by another answer to a similar problem.
- There’s an IsValid check on the “Get Controlled Pawn” function output to check if we actually are getting a controlled pawn.
With these changes, we were able to pinpoint the issue: there’s no pawn possession taking place. With event onpossess, it never triggers (i.e., no possession is taking place). If we replace onpossess with beginplay, our IsValid tells us that “Get Controlled Pawn” is returning null. So the AI blueprint is actually never set to be the AI controller of the pawn. So the question is, why is this happening? We also tried setting the controller on beginplay within Enemy_Blueprint to the AI controller, but no dice. Also, the behavior tree is naturally never triggered, so our Enemy never follows the player as intended.
I’ll be happy to provide any additional information. Please help!