Behavior Trees Rotate to face BB Entry and MoveTo can never work together reasonably?

After much research, trial and error it appears that there are several values that need to be set in tandem in order to get this functionality to work. Here’s the steps for anyone else looking into this:

  • Make sure Use Controller Rotation Yaw is disabled on the main component of the AI agent pawn.
  • In the Movement Component of same pawn, set Orient Rotation to Movement disabled, and Use Controller Desired Rotation to enabled.
  • Rotation Rate Z value of the Movement component of the pawn controls rotation speed. This does not take into consideration direction, so if the move to is toward a position behind the agent, the agent will appear to move backward as it rotates until forward motion takes over. Higher Z rotation minimizes the oddness of this transition.
  • Set AI Focus can be done through the AI Controller to get rotation, or the use of the Rotate to face BB entry in behavior tree. For some reason, I have been unable to get the Set Default Focus service in the behavior tree but the Rotate To Face BB Entry works.
  • FYI: Set AI Focus turns the capsule, not the head of the agent. So if you are looking for a more realistic means of using a view cone then you will have to code it from what I can tell. AI Perception also uses the capsule for its view cone setup.

If anyone reading this has found any better methods that above please let me know.

30 Likes