Behaviour tree quiqstart guide - new functionality
Hello Guys. I was recently learning about behaviour trees from official quickstart guide https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/index.html
Since everything is working perfect, I would like to add a new functionality to this behaviour tree. Lets say we spawn 3 enemies. I would like to add some behaviour to ai enemy - a variable which every one of them would check during the "AggroCheck". To imitate some "swarm" behaviour by using only one variable. I made a sketch of what I would like to achieve, it's on attachment.
I thought to set it up in "AggroCheck" Service. During spotting player a variable, lets call it "roar" would be setting to "true". In the same AggroCheck, there would be also a node that would be checking if other pawns noticed player. And this is my biggest reflection - how can I make it in this blueprint that the pawn would be checking other pawns around some radius? (to see if they noticed the player).
Well you more or less already came to the right Conclusion on your own. So if you see the Player you change your state to Chasing the player and Check if there are other Enemies around you by say Get Overlapping Actors -> foreach -> check if overlapped Actor is already in the Chasing State (to avoid infinite loop, ignore those) if not make him do the exact same thing your first Enemy did (you can create a Function for that). Everyone in Range will end up in the Chasing state. Thats about it in a nutshell.
Good Luck and have Fun =)
answered Dec 01 '17 at 07:41 PM
I hope to simplified it with your example, however Im missing where to put As enemy character from "cast to enemy character" node. In the end, it has to go to "set blackboard value as object".
However now im thinking, isn;t this script is running for every enemy character? So in the end, I may set up this for enemies around but right after this script is running for them and they dont see the character so they stand in place.
Follow this question
Once you sign in you will be able to subscribe for any updates here