Efficiently Running Dynamic Behavior on an NPC

Behavior trees will work but can become cumbersome when you start doing more complex behaviors, but a more future proof technique may be State Trees and Smart Objects as BTs are generally falling out of favor. They are pretty much custom built for the type of behavior you are describing, and are what are used for setting up custom interactions between actors:

The smart objects allow you to embed it’s own state tree to activate on the actor when an actor interacts with it. This behavior may require another plugin, GameplayBehaviorSmartObjects maybe? There are several plugins that work with smartobjects… if you are more comfortable with behavior trees there is a similar plugin that integrates behavior trees and smart objects also.

It’s a big chunk of meat to bite into, but really powerful once you get set up.

2 Likes