Hi, I want to know if this is a bug or not, and how I can fix it.
- I have a door with a Child Actor (SmartLinkComponent) that calls a function in the AI when the AI starts crossing it (EventReceiveSmartLinkReached). The AI then triggers a dispatcher, which is bound in
BTTTask_MoveTo_OpenDoors
. - In the Behavior Tree, the AI has two branches: patrolling and chasing the player (which checks if the player key is set—this happens in a
BTService
that detects if the AI sees the player). - When patrolling, the AI (if it has door on its way) opens the door and waits for it to fully open (its speed is set to zero). If, at the moment the AI starts crossing the door using the Smart Link, it suddenly sees the player, the chase branch interrupts the patrol branch, and the AI’s new target becomes the player.
- The problem is that when the AI’s target switches from patrol target location to the player ref while it’s still moving through the Smart Link, the AI turns back to the start of the Smart Link, moves through it again, and only then continues toward the player.
Questions:
- Is this system too complex, or is it a reasonable way to structure AI movement?
- How can I make the AI continue toward the player from its current position instead of returning to the start of the Smart Link and crossing it again?
P.S. noise system is not essential, don’t pay attention to it
videos:
(if videos are expired, ask me to upload them again)