Using restart behavior tree or send / has received event tasks on other prefab objects

We're using BD on a procedurally generated map and we're using prefab game objects. We're creating a simple ecosystem of foxes, bunnies and carrots. Let me present my problem using the behavior trees of bunnies.

Bunnies have 3 states. We use conditional aborts.

As a higher priority state, they flee whenever they see a predator
As a lower priortiy state, they look for food when they're hungry
As the lowest priority state, they start wandering.

We have carrots spawning around the scene all the time. Bunnies sometimes can't find them for a while and then they pop up soon after. Now the problem is, within distance doesn't trigger when the carrot spawn within its range. I think this is normal and considering performance bunnies shouldn't search for carrot on every tick.

Instead, I thought of using send event / has received event but I can't choose a tag for the objects I want to send this event. The inspector only allows me to choose a specified game object.

I am no good at coding myself and I wanted to used BD without the help of my programmers. Is there a solution to do this without writing a new task?

Thank you in advance.

unknown.png
 
The Within Distance task can use tags but it will only gather all of the tagged objects when it is started for performance reasons. I just looked and Within Distance doesn't allow for a list of transforms to check. I'll add this to the next update. With this list of targets you'll be able to add/remove the transform when the carrot spawns. This will take some scripting though. I'll try to think of another way without any scripting, I'm sure that Playmaker or Bolt could be used in this situation.
 
Thank you Justin, you have a great support. I'm in love with this tool already :)

Also, programmers are involved and we're doing some scripting and adding a few extra functions to existing tasks. Let me know if you would be interested to add the changes we're working on to your end.

I would be looking for the next update for your solution.
 
Top