Having the Boss Behavior Tree function properly


When designing the Weaver Worm boss, I figured that a behavior tree would be optimal. However, I soon learned that with using a behavior tree, I needed the script to the able to communicate with other scripts. Since the behavior tree didn't use MonoBehaviour, I didn't have access to typically used functions and properties that are used for controlling game flow. This is where Unity Events came in. Using Unity Events, I was able to use the behavior tree to send our events to other scripts that were subscribed to those events to handle MonoBehaviour functionality. Since I can just choose what subscribes to the broadcasted event, I can make sure the behavior tree sends out a signal to other scripts without needing to worry about making MonoBehaviour work within the behavior tree. Since in order to do so with how the behavior tree was built, it would be quite difficult. However, something I would like to add, is that I figured out that the behavior tree was was too much and that since the boss wasn't overly complex, something more simple with MonoBehaviour would have been better. Nonetheless, it was a great learning experience and helped me to understand behavior trees better and to know when it's useful and not useful.

Leave a comment

Log in with itch.io to leave a comment.