# \#behavior-tree-task

**URL:** https://forums.unrealengine.com/tag/behavior-tree-task/8679.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [Troubles with a task that makes an npc turn left and right ](https://forums.unrealengine.com/t/troubles-with-a-task-that-makes-an-npc-turn-left-and-right/2693916)

<div class="topic-metadata">

**Author:** [@fightforthepipe](https://forums.unrealengine.com/u/fightforthepipe)\
**Replies:** 3\
**Last updated:** [January 22, 2026, 7:46am UTC](https://forums.unrealengine.com/t/troubles-with-a-task-that-makes-an-npc-turn-left-and-right/2693916 "2026-01-22T07:46:13Z")

</div>

My UE version is 5.5.4. So here is the deal: i have a loop that makes an npc turn towards one direction (let’s say it turns to the right) then it waits a few seconds, after that it turns the other direction. Then it sta…

---

## [Getting AI to interrupt/abort Behavior Tree MoveTo Task](https://forums.unrealengine.com/t/getting-ai-to-interrupt-abort-behavior-tree-moveto-task/306919)

<div class="topic-metadata">

**Author:** [@MajinKen\_1](https://forums.unrealengine.com/u/MajinKen_1)\
**Replies:** 27\
**Last updated:** [December 2, 2025, 4:10pm UTC](https://forums.unrealengine.com/t/getting-ai-to-interrupt-abort-behavior-tree-moveto-task/306919 "2025-12-02T16:10:32Z")

</div>

I’ve tried making sense of this with other similar topics with no luck. How would I get an AI character to abort its current MoveTo Task? The goal is to differentiate between moving away from the player character or mov…

---

## [this was nullptr when trying to get coordinates](https://forums.unrealengine.com/t/this-was-nullptr-when-trying-to-get-coordinates/2079838)

<div class="topic-metadata">

**Author:** [@M4yh3m.exe](https://forums.unrealengine.com/u/M4yh3m.exe)\
**Replies:** 20\
**Last updated:** [October 24, 2024, 9:18am UTC](https://forums.unrealengine.com/t/this-was-nullptr-when-trying-to-get-coordinates/2079838 "2024-10-24T09:18:28Z")

</div>

Hello everyone, I’m making a multiplayer game and at the moment I’m trying to implement the movement of a character on the ceiling, I chose the simplest option to just flip and raise the mesh to the ceiling, and leave th…

---

## [Adding and Destroying sounds with Behavior Tree Tasks](https://forums.unrealengine.com/t/adding-and-destroying-sounds-with-behavior-tree-tasks/2062083)

<div class="topic-metadata">

**Author:** [@MaximilianMander](https://forums.unrealengine.com/u/MaximilianMander)\
**Replies:** 0\
**Last updated:** [October 10, 2024, 5:03pm UTC](https://forums.unrealengine.com/t/adding-and-destroying-sounds-with-behavior-tree-tasks/2062083 "2024-10-10T17:03:33Z")

</div>

Hello there! What I am trying to do is, to play multiple long Audiofiles within different tasks within the Behavior tree. I want Audiofile 1 to stop when either Task 1 gets aborted or when Task 2 starts. At the moment…

---

## [How to create a UBTTAsk sub task in C++?](https://forums.unrealengine.com/t/how-to-create-a-ubttask-sub-task-in-c/456460)

<div class="topic-metadata">

**Author:** [@TheSmokingGnu](https://forums.unrealengine.com/u/TheSmokingGnu)\
**Replies:** 2\
**Last updated:** [July 6, 2024, 4:23pm UTC](https://forums.unrealengine.com/t/how-to-create-a-ubttask-sub-task-in-c/456460 "2024-07-06T16:23:01Z")

</div>

I have a melee character with some range, stored in MeleeComponent. I now want to create a task in behaviour tree (using blueprints) that would move to enemy with accepted radius of melee range. Unfortunately, I cannot …

---

## [Problem calling custom events from AI behavior tree's task](https://forums.unrealengine.com/t/problem-calling-custom-events-from-ai-behavior-trees-task/413261)

<div class="topic-metadata">

**Author:** [@sounderdisc](https://forums.unrealengine.com/u/sounderdisc)\
**Replies:** 20\
**Last updated:** [July 4, 2024, 6:56am UTC](https://forums.unrealengine.com/t/problem-calling-custom-events-from-ai-behavior-trees-task/413261 "2024-07-04T06:56:24Z")

</div>

I have custom events for my two ai characters, RobotShooter and RobotCharger, which are both children of RobotParent and have their own custom event called “AttackPlayer.” My ai behavior tree works perfectly except for a…

---

## [Boss enemy get attack target distance for do another attack ](https://forums.unrealengine.com/t/boss-enemy-get-attack-target-distance-for-do-another-attack/1915454)

<div class="topic-metadata">

**Author:** [@EmirhanOnuk](https://forums.unrealengine.com/u/EmirhanOnuk)\
**Replies:** 1\
**Last updated:** [June 25, 2024, 1:43am UTC](https://forums.unrealengine.com/t/boss-enemy-get-attack-target-distance-for-do-another-attack/1915454 "2024-06-25T01:43:58Z")

</div>

Hi I am doing a boss for my game, but I am stuck on the behaviour tree. What I want to do is: If the boss is far enough to attack the target (example 2mt distance) his gonna start the attack. Right now he is it’s just a…

---

## [BTTask MoveTo -\> actor always fails in Lyra 5.4](https://forums.unrealengine.com/t/bttask-moveto-actor-always-fails-in-lyra-5-4/1880523)

<div class="topic-metadata">

**Author:** [@Astaraa](https://forums.unrealengine.com/u/Astaraa)\
**Replies:** 3\
**Last updated:** [May 31, 2024, 6:00pm UTC](https://forums.unrealengine.com/t/bttask-moveto-actor-always-fails-in-lyra-5-4/1880523 "2024-05-31T18:00:06Z")

</div>

Red line indicates although target actor is set, task fails to move to it. Target actor is Object of base class Actor. MoveTo → vector works for default Lyra bot behavior but fails in other tests which is one of the…

---

## [Behavior Tree task bug? Blackboard Key Selector variable default "None" value being overridden in editor](https://forums.unrealengine.com/t/behavior-tree-task-bug-blackboard-key-selector-variable-default-none-value-being-overridden-in-editor/1809930)

<div class="topic-metadata">

**Author:** [@ProtoProfessor](https://forums.unrealengine.com/u/ProtoProfessor)\
**Replies:** 0\
**Last updated:** [April 18, 2024, 5:24pm UTC](https://forums.unrealengine.com/t/behavior-tree-task-bug-blackboard-key-selector-variable-default-none-value-being-overridden-in-editor/1809930 "2024-04-18T17:24:22Z")

</div>

Hi all, I’m experiencing what appears to be a bug with BT tasks in 5.3.2 and am looking for confirmation and/or potential workarounds. For me the behavior happens with any task that has an instance-editable variable of …

---

## [AI Enemy Not Performing Task While Moving](https://forums.unrealengine.com/t/ai-enemy-not-performing-task-while-moving/1790892)

<div class="topic-metadata">

**Author:** [@GV-Rafael-III](https://forums.unrealengine.com/u/GV-Rafael-III)\
**Replies:** 4\
**Last updated:** [April 8, 2024, 5:54pm UTC](https://forums.unrealengine.com/t/ai-enemy-not-performing-task-while-moving/1790892 "2024-04-08T17:54:16Z")

</div>

I am trying to get my AI-controlled enemies to shoot or reload while moving towards the player. The “Shoot” and “Reload” tasks just play the corresponding animation montage, and return EBTNodeResult::Succeeded. Unfortuna…

---

## [MoveTo task: How to move to player's location at any given location they are at](https://forums.unrealengine.com/t/moveto-task-how-to-move-to-players-location-at-any-given-location-they-are-at/317147)

<div class="topic-metadata">

**Author:** [@MajinKen\_1](https://forums.unrealengine.com/u/MajinKen_1)\
**Replies:** 10\
**Last updated:** [March 21, 2024, 8:31am UTC](https://forums.unrealengine.com/t/moveto-task-how-to-move-to-players-location-at-any-given-location-they-are-at/317147 "2024-03-21T08:31:55Z")

</div>

From what I’m noticing in my behavior tree, the moveTo task moves to a vector location given to it; it either makes it to its destination or terminates from stopMovement node. However, an issue has come up that I’m tryin…

---

## [Orienting Characters to Used SmartObjects](https://forums.unrealengine.com/t/orienting-characters-to-used-smartobjects/754167)

<div class="topic-metadata">

**Author:** [@Wahooney](https://forums.unrealengine.com/u/Wahooney)\
**Replies:** 1\
**Last updated:** [March 8, 2024, 7:30pm UTC](https://forums.unrealengine.com/t/orienting-characters-to-used-smartobjects/754167 "2024-03-08T19:30:25Z")

</div>

I followed the Smart Objects Quick Start and got the basics sorted out quickly enough. But it seems that orienting the character to the SmartObject is not handled by Use Claimed Gameplay Behaviour Smart Object. I tried o…

---

## [Stuck on root node when running behavior tree](https://forums.unrealengine.com/t/stuck-on-root-node-when-running-behavior-tree/310871)

<div class="topic-metadata">

**Author:** [@jechli\_1](https://forums.unrealengine.com/u/jechli_1)\
**Replies:** 11\
**Last updated:** [April 9, 2023, 5:02pm UTC](https://forums.unrealengine.com/t/stuck-on-root-node-when-running-behavior-tree/310871 "2023-04-09T17:02:41Z")

</div>

Here’s a screenshot of what I mean: The root node of the behavior tree is the only one running. Is there a specific reason for this? This same behavior tree sequence worked in 4.6, so I’m wondering if anything change…

---

## [UBTFunctionLibrary::SetBlackboardValueAsObject() (failed: OwnerComp != nullptr)](https://forums.unrealengine.com/t/ubtfunctionlibrary-setblackboardvalueasobject-failed-ownercomp-nullptr/1308043)

<div class="topic-metadata">

**Author:** [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Replies:** 1\
**Last updated:** [September 22, 2023, 11:52pm UTC](https://forums.unrealengine.com/t/ubtfunctionlibrary-setblackboardvalueasobject-failed-ownercomp-nullptr/1308043 "2023-09-22T23:52:23Z")

</div>

I have a problem setting the node owner in this function. UBTFunctionLibrary::SetBlackboardValueAsObject(this, Base, Actor); I got this error: My class is like this: class UBTT\_GetTeamReference : public UBTTask\_B…

---

## [NPC Animation Blueprints and AI Behavior Trees C++](https://forums.unrealengine.com/t/npc-animation-blueprints-and-ai-behavior-trees-c/1234939)

<div class="topic-metadata">

**Author:** [@Krishna\_Chaithan1](https://forums.unrealengine.com/u/Krishna_Chaithan1)\
**Replies:** 0\
**Last updated:** [July 20, 2023, 4:47pm UTC](https://forums.unrealengine.com/t/npc-animation-blueprints-and-ai-behavior-trees-c/1234939 "2023-07-20T16:47:03Z")

</div>

Hi, I’m trying to create an WolfAI( using C++). These are the steps I have followed i) Created a new C++ class for Wolf AI…derived from Character class. ii) Created a new AI-Controller C++ class. And added AIPerception…

---

## [How to interrupt latent functions in a behavior task? Setting a decorator to abort self doesn't work](https://forums.unrealengine.com/t/how-to-interrupt-latent-functions-in-a-behavior-task-setting-a-decorator-to-abort-self-doesnt-work/1199178)

<div class="topic-metadata">

**Author:** [@DevbyMoonlight](https://forums.unrealengine.com/u/DevbyMoonlight)\
**Replies:** 2\
**Last updated:** [June 15, 2023, 9:18am UTC](https://forums.unrealengine.com/t/how-to-interrupt-latent-functions-in-a-behavior-task-setting-a-decorator-to-abort-self-doesnt-work/1199178 "2023-06-15T09:18:31Z")

</div>

I’m using “Move to Location or Actor” for my aerial movement AI. It appears I cannot interrupt this - decorators with self aborts don’t do anything, neither does “Immediately Stop Movement” in a tick event. The internet…

---

## [Set blackboard value in tree](https://forums.unrealengine.com/t/set-blackboard-value-in-tree/443692)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_6e65e547](https://forums.unrealengine.com/u/anonymous_user_6e65e547)\
**Replies:** 7\
**Last updated:** [February 25, 2019, 6:33pm UTC](https://forums.unrealengine.com/t/set-blackboard-value-in-tree/443692 "2019-02-25T18:33:16Z")

</div>

Hi there! How can I set a blackboard value (boolean) in behavior tree? Do I must create a task to do it? It seems dirty to me, to change it there. The boolean selects which parts of the tree should be executed so to me …

---

## [Behavior tree stuck at trying to set variable?](https://forums.unrealengine.com/t/behavior-tree-stuck-at-trying-to-set-variable/823792)

<div class="topic-metadata">

**Author:** [@GKoch](https://forums.unrealengine.com/u/GKoch)\
**Replies:** 8\
**Last updated:** [March 26, 2023, 7:32pm UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-trying-to-set-variable/823792 "2023-03-26T19:32:49Z")

</div>

So, I set a target variable for my AI to attack. However, once the target is destroyed, my AI gets stuck trying to set that variable. Is there a way to abort? here’s the task: and the relevant snippet of the tree: …

---

## [Behavior Tree switches task rapidly before completing them.](https://forums.unrealengine.com/t/behavior-tree-switches-task-rapidly-before-completing-them/793455)

<div class="topic-metadata">

**Author:** [@Ashutosh\_Sharma](https://forums.unrealengine.com/u/Ashutosh_Sharma)\
**Replies:** 0\
**Last updated:** [March 18, 2023, 8:05am UTC](https://forums.unrealengine.com/t/behavior-tree-switches-task-rapidly-before-completing-them/793455 "2023-03-18T08:05:54Z")

</div>

I have created an AI character with all its components like Tree, Board, Controller etc. So the issue is, sometimes the character switches between these CatJump and MoveTo nodes very rapidly before actually performing…

---

## [Move To node doesn't finish when key is cleared](https://forums.unrealengine.com/t/move-to-node-doesnt-finish-when-key-is-cleared/496798)

<div class="topic-metadata">

**Author:** [@WhiteTeapot](https://forums.unrealengine.com/u/WhiteTeapot)\
**Replies:** 1\
**Last updated:** [February 11, 2022, 11:56pm UTC](https://forums.unrealengine.com/t/move-to-node-doesnt-finish-when-key-is-cleared/496798 "2022-02-11T23:56:05Z")

</div>

This is part of a behavior tree for chasing a slow moving projectile BP\_Actor (TargetEnergy BB key) that is destroyed on collision. After the projectile is destroyed the upstream service will set the relevant key to…

---

## [The ia does not leave eyes the Player ue4 C++](https://forums.unrealengine.com/t/the-ia-does-not-leave-eyes-the-player-ue4-c/490127)

<div class="topic-metadata">

**Author:** [@janaky](https://forums.unrealengine.com/u/janaky)\
**Replies:** 0\
**Last updated:** [October 22, 2021, 3:23pm UTC](https://forums.unrealengine.com/t/the-ia-does-not-leave-eyes-the-player-ue4-c/490127 "2021-10-22T15:23:28Z")

</div>

’m coding an ia with a c++ behavior tree. My concern is the fact that must follow the player then if he sees it more that returns in the other sequences. So I used a UPawnSensingComponent and in my mycharacter.cpp: I put…

---

## [Blackboard get value as int is always 0?](https://forums.unrealengine.com/t/blackboard-get-value-as-int-is-always-0/487918)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_b32d65871](https://forums.unrealengine.com/u/anonymous_user_b32d65871)\
**Replies:** 3\
**Last updated:** [August 24, 2021, 7:07pm UTC](https://forums.unrealengine.com/t/blackboard-get-value-as-int-is-always-0/487918 "2021-08-24T19:07:38Z")

</div>

Hello there :frowning: I have been trying to troubleshoot this problem for a long time. So I’m making a game where if you talk to an NPC and choose the right choices you will get +1 Affection from them. This works per…

---

## [\[Multiplayer\] Replicate Anim Montage in a Behavior Tree Task](https://forums.unrealengine.com/t/multiplayer-replicate-anim-montage-in-a-behavior-tree-task/481790)

<div class="topic-metadata">

**Author:** [@Ocir-Tello](https://forums.unrealengine.com/u/Ocir-Tello)\
**Replies:** 1\
**Last updated:** [April 12, 2021, 6:26pm UTC](https://forums.unrealengine.com/t/multiplayer-replicate-anim-montage-in-a-behavior-tree-task/481790 "2021-04-12T18:26:35Z")

</div>

Hello mates, I struggle with an issue about replicating an anim montage in a multiplayer setup, in a task of the AI’s Behavior Tree. Everything else works perfectly, the behavior tree, every tasks, the anim montage its…

---

## [Ai move to actor behaviour tree](https://forums.unrealengine.com/t/ai-move-to-actor-behaviour-tree/478568)

<div class="topic-metadata">

**Author:** [@OshriMaki](https://forums.unrealengine.com/u/OshriMaki)\
**Replies:** 0\
**Last updated:** [February 10, 2021, 11:50am UTC](https://forums.unrealengine.com/t/ai-move-to-actor-behaviour-tree/478568 "2021-02-10T11:50:29Z")

</div>

Hey, I am trying to make my AI move to an actor location from the behavior tree but it keeps going towards 00,00,00 location. I can’t get the actor location and demand the AI to move there, Above is the AI find the l…

---

## [Moving between actors using move to actor fails](https://forums.unrealengine.com/t/moving-between-actors-using-move-to-actor-fails/471091)

<div class="topic-metadata">

**Author:** [@mistercokes](https://forums.unrealengine.com/u/mistercokes)\
**Replies:** 6\
**Last updated:** [September 13, 2020, 6:53am UTC](https://forums.unrealengine.com/t/moving-between-actors-using-move-to-actor-fails/471091 "2020-09-13T06:53:25Z")

</div>

I set up a logic that a character moves to a resource actor, picks up an item and brings it to a storage actor. This logic is repeated constantly. I set an actor variable later used in the AI where the character shall …

---

## [Custom BT task doesn't move character](https://forums.unrealengine.com/t/custom-bt-task-doesnt-move-character/455877)

<div class="topic-metadata">

**Author:** [@Darth\_Biomech](https://forums.unrealengine.com/u/Darth_Biomech)\
**Replies:** 0\
**Last updated:** [September 24, 2019, 6:59am UTC](https://forums.unrealengine.com/t/custom-bt-task-doesnt-move-character/455877 "2019-09-24T06:59:50Z")

</div>

My navigation is set up so that doors have navmesh modifier that’s impassable in “vents” version of navfilter being used, but passable in the regular navfilter. The idea is that the BT Task will first attempt to first l…

---

## [Blackboard Sequence is skipping a node](https://forums.unrealengine.com/t/blackboard-sequence-is-skipping-a-node/441956)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_db3a3d69](https://forums.unrealengine.com/u/anonymous_user_db3a3d69)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 2:16am UTC](https://forums.unrealengine.com/t/blackboard-sequence-is-skipping-a-node/441956 "2019-01-24T02:16:04Z")

</div>

I have a simple AI setup for moving to a player and then attacking once they have reached them. However the sequence node that leads into those nodes is skipping the attack one. And this is a gif of the behavior: (…

---

## [Can't change a BB/BT boolean from a pawn BP](https://forums.unrealengine.com/t/cant-change-a-bb-bt-boolean-from-a-pawn-bp/436842)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_c60c64a5](https://forums.unrealengine.com/u/anonymous_user_c60c64a5)\
**Replies:** 0\
**Last updated:** [November 1, 2018, 4:37pm UTC](https://forums.unrealengine.com/t/cant-change-a-bb-bt-boolean-from-a-pawn-bp/436842 "2018-11-01T16:37:28Z")

</div>

I’m trying to swap from a simple roam AI to a follow player character AI on end overlap. Basically trying to build a train, so to speak, of pawns following behind the player character. I have the mounting and po…

---

## [Stopping and Restarting Brain Component leaving a trail of "Garbage"?](https://forums.unrealengine.com/t/stopping-and-restarting-brain-component-leaving-a-trail-of-garbage/436101)

<div class="topic-metadata">

**Author:** [@Studiozone](https://forums.unrealengine.com/u/Studiozone)\
**Replies:** 0\
**Last updated:** [October 22, 2018, 2:59am UTC](https://forums.unrealengine.com/t/stopping-and-restarting-brain-component-leaving-a-trail-of-garbage/436101 "2018-10-22T02:59:27Z")

</div>

Hi everyone, maybe some of you can shed a light on this stuff. I notice when I for each time “Stopping” and “Restarting” the Brain Component that is connected to the AI Controller, it seams to leave a trail of “Garbage”…

---

## [How to access target point from world editor inside AI Behavior Tree task?](https://forums.unrealengine.com/t/how-to-access-target-point-from-world-editor-inside-ai-behavior-tree-task/426410)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_87d32622](https://forums.unrealengine.com/u/anonymous_user_87d32622)\
**Replies:** 3\
**Last updated:** [June 3, 2018, 10:30pm UTC](https://forums.unrealengine.com/t/how-to-access-target-point-from-world-editor-inside-ai-behavior-tree-task/426410 "2018-06-03T22:30:07Z")

</div>

Hello, as the question says, I’m trying to access a target point from the world editor in my AI’s behavior tree so i can get him to effectively patrol. I was watching this tutorial on AI patrol Unreal Engine 4 - AI Patr…

[Next page](https://forums.unrealengine.com/tag/behavior-tree-task/8679.md?match_all_tags=true&page=1&tags%5B%5D=behavior-tree-task)
