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:
Sphere Pawn stops exactly in front of wall:
For ‘AI-driven’ method the setup for BehaviorTree is pretty much simple:
BTT_OffsetMove task Blueprint:
After assigning an AI Controller with this BehaviorTree to our Pawn it just starts passing through the wall:
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.
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:
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:
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