Slow Response When Sight Is Sensed

I have a behavior tree that doesn’t respond immediately the player is sensed. I’m trying to get the enemy to move from a patrolling state to a chasing state. With the debug on I can see the player is detected but the abort doesn’t respond right away. The behavior of both states work fine. The abort seems to be the problem.

The Sense system has a bunch of optimizations as it is associated with world queries. (these are slow)

One of those optimizations is that queries are not made each frame. Instead the default is 0.5s, which shouldn’t be that noticeable in most projects.

Try lowering the Sensing Interval and say how it goes.

If this doesn’t help, the delay might lie elsewhere in your logic.

Thanks for getting back to me. I did manage to get it working when I changed the decorator at the top of the tree to Aborts Self. I thought Aborts Both and was the right one to use. Can someone explain why that is?