AI Selector Node does not work

Hello, I’m trying to make a simple behaviour tree that will check if the AI can see an object of interest and move towards it’s location if seen. However I have an issue where in which my AI selector node will not execute the second branch if it cannot see an object of interest and I don’t understand why it is failing. I have the behaviour tree and relevant scripts below. The only issue that I could see affecting this tree is that I have a spawning function that takes an NPC and a behaviour tree, meaning the behaviour tree is not set to the AI by default.

AI Spawning function

Behaviour Tree (Right Side works when selector is not included)

AI Perception Script

Hello @Suspiria901 how are you?

As far as I can see, the problem could be in your Blackboard Base Condition.

Your left branch condition has “aborts both” set. And it should be set to “self”, so when “SeeObject” becomes set mid-execution, it aborts the right branch and switches left, and when “SeeObject” is not set, it simply fails and the Selector moves right.

That should solve the issue!

If not, please share with us your Blackboard so we can analyze the issue more in dept!