Advise Regarding Behaviour Trees

Hello, I am generally new to AI, I just wanted advice on weather I am implementing my AI correctly or if there is a more efficient way to implement what I wish to achieve. :smiley:

Here is my behaviour tree:

ce843cf590f6633bf6a2d1116cf86087cd244ff3.jpeg

The states / Behaviours:

  • Wondering - Bot just wonders around random target locations I have place within the map

  • Chase - Bot chases after player when in sight range

  • ChaseFire - Bot fires as well as moves towards the player at the same time when in sight range and fire range

  • StationaryFire - Bot fires but does not move towards the player when in fire range

  • Here is my AIStateManager Service:

    e23ff3d2e2a9573987b34e9f4222cbade86ae55d.jpeg

    This basically checks if the player is within sight or/and firing range dependant on what it is it will set the state.

    One thing I am currently stuck on is breaking out of the state Wondering, it will only break out once it reaches the target location and then proceed to chase. I would want it to break out as soon as the player was in range.