Some BT related issues

hy guys i’m in need of a little “help” with the ai

currently i’m working with using a BT for my enemies and i’m experiencing 2 weirds issues:

1 - Enemy attacking only after leave the "vision range:

here my enemyBP






i’m using a collision box named vision box as enemy trigger to attack and using the 3 functions to call for the “attack”, now here my BT:


ive created 2 keys one for the player for the ai recognize the player and another for the ai "return to base which is the second issue but let’s focus on the first one.

then i’ve created this decorator:


also this task

what it was supposed to means, when the player enter in the cube zone, the npc move to the character and if it get “in the close range” it will attack", however it’s not happening, the enemy only move close to the player and only attack if the player “leave the cube”, it is unable to attack unless the player get faraway enought like out of the vision box then he will attack before go back “home”, any help or know where i’s the issue?
Another detail is which i’m not using a "controller AIBP, i’m using a spawn bp then in that “spawn bp” i’m activating the ai with the spawn like here:

anyone know how i can fix it?? any tips on what is going wrong here???

2 - "base Return:

since i’ve already linked the BT here just the “gohome” task to make then go back to the start location


this "set my startlocation in the blackboard, and while it work perfect for a “single unit” it is a big issue if i just use the “same spawn” multiple times because all the ai will try to go to the "first spawn location which was what i setup in the startlocation key.

i’ve tried this:


i’ve tried to call the spawnpoint as reference but it also didn’t worked, and the enemy stopped to 'go back home" and only followed me, any way to create a "to find each spawn point location and use it as “go back” point for each replication of the enemy spawn, all will use the same bp but based on the place i will put each one they will have they own "return/reset point.

any help is very welcome.