# \[Possible bug\] AddActorLocalOffset fails with collision detection inside BehaviorTree task

**URL:** <https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, bug-report, question, Blueprint\
**Created:** [March 22, 2015, 4:20pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132 "2015-03-22T16:20:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Revenvik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Revenvik](https://forums.unrealengine.com/u/Revenvik)\
**Post date:** [March 22, 2015, 4:20pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132/1 "2015-03-22T16:20:03Z")

</div>

Hi,  
it seems, i’ve encountered a strange bug with collision detection during the execution of **AddLocalOffset** command inside a **Blueprint task** for **BehaviorTree**.

The problem appears only there, because, if you add this command inside Pawn blueprint, the collision detection between pawn and level geometry starts perfectly working.

Blueprint graph:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/6/2466e70297bff3f37282d1949b98a4ec0b4e3dd4.jpeg) ](https://i.imgur.com/z6rZ5Jz.jpg)

Sphere Pawn stops exactly in front of wall:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/1/2e1d7efbff240a43aa51e02c7e874dd029655ac7.jpeg) ](https://i.imgur.com/DkY07jh.jpg)

* * *

For ‘AI-driven’ method the setup for BehaviorTree is pretty much simple:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/a/71a839529e59a9cc61df5beb65f6473b32dbbcfe.jpeg) ](https://i.imgur.com/RanQkLd.jpg)

BTT\_OffsetMove task Blueprint:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/8/9c80ce54df3efa725cbf62c11d080172dca2d5ac.jpeg) ](https://i.imgur.com/PMv7l5O.jpg)

After assigning an AI Controller with this BehaviorTree to our Pawn it just starts passing through the wall:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/5/4d57dc5607caca150c8142b131a791e211d80fc7.jpeg) ](https://i.imgur.com/A3tE2rQ.jpg)

Root Pawn sphere collision setup:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/a/98aed782931685ab71fee8dcda796ec42ee40796.jpeg) ](https://i.imgur.com/0BELMIx.jpg)

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [March 24, 2015, 12:35pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132/2 "2015-03-24T12:35:39Z")

</div>

I’m surprised it actually compiles 🙂 I suggest you re-thing the logic of that code. Current setup will result in `Add Actor Local Offset`'s `Target` being null since it gets executed as part of the `Tick` event, not the `Receive execute`. In general, when things are not working as intended I recommend looking around with debugging tools - just place a break-point on the `Add Actor Local Offset` and see where it came from and what are the input values.

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![Revenvik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Revenvik](https://forums.unrealengine.com/u/Revenvik)\
**Post date:** [March 24, 2015, 1:29pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132/3 "2015-03-24T13:29:06Z")

</div>

Yeah, I’ve noticed this wrong pin connection just after a few moments I posted this report, but the thing is… there is no difference at all. The controlled pawn still passes through the wall.  
Also, with a breakpoint placed on the AddActorLocalOffset node we can see, that even ReceiveExecute event returns proper reference to our Pawn:

[http://i.imgur.com/UvP1poa.jpg](http://i.imgur.com/UvP1poa.jpg)

By the way, the Hit event is also being properly registered even in this way, I have no suggestions on what can be wrong here tbh

---

<div class="post-metadata">

**Author:** ![Revenvik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Revenvik](https://forums.unrealengine.com/u/Revenvik)\
**Post date:** [March 24, 2015, 1:54pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132/4 "2015-03-24T13:54:18Z")

</div>

I’ve uploaded a test project (done with UE4.7.3 downloaded from launcher), hope this will help

link text

---

<div class="post-metadata">

**Author:** ![Revenvik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Revenvik](https://forums.unrealengine.com/u/Revenvik)\
**Post date:** [April 6, 2015, 7:41pm UTC](https://forums.unrealengine.com/t/possible-bug-addactorlocaloffset-fails-with-collision-detection-inside-behaviortree-task/312132/5 "2015-04-06T19:41:32Z")

</div>

Any news on that? I still don’t have any appropriate solution or a workaround.  
This issue is not critical for me, but still important. I move my enemy Pawns with AddActorLocalOffset and need to check collision detection with environment.  
The only one workaround I found was to enable ‘Simulation Generates Hit Events’ on Pawn’s collision shape and check for EventHit inside Blueprint to stop enemy.  
This does work somehow, but is so far from ideal:

[http://i.imgur.com/yY0776H.jpg](http://i.imgur.com/yY0776H.jpg)

As you can see, it didn’t work for all the enemies. The one on the left stopped almost inside the wall, while the right one passed through the wall. Has to mention, that the enemies’ fly speed is very high
