Use a unique variable across several Behaviour Trees

Hello, i am having trouble trying to figure out how to get 1 random point for a group of my AI to use. I am currently doing flocking and wanting them to all move towards the same target. If i work out the point in the behavior tree, it gives each of the NPC’s their own random point. Is there any way i can work out a point elsewhere and get each behavior tree to reference it?

Thanks!

Well, you can upgrade to 4.7 and use awesome new AI feature of BB entries synchronization! :wink:

You can also, you know, code it (and yeah, setting up BPs is coding as well :P). You’d need to create an actor class that would be calculating/storing that data and have BT tasks/decorators look for that actor instance on map to access data.

Or you can used custom GameInstance class, that would probably be easier to access. Regardless, you need to implement your own BT nodes to be able to access that data.

Cheers,

–mieszko

I read through all of 4.7 release notes and noticed that, should help alot. It took me a little while to realise BB’s were not shared but individual, the name threw me off thinking that the BB was my problem :frowning:

Thank you very much for the reply :slight_smile: