# Efficiently Running Dynamic Behavior on an NPC 

**URL:** <https://forums.unrealengine.com/t/efficiently-running-dynamic-behavior-on-an-npc/2550369>\
**Category:** Programming & Scripting\
**Tags:** npc, Behavior-Tree, unreal-engine, question\
**Created:** [June 10, 2025, 7:09pm UTC](https://forums.unrealengine.com/t/efficiently-running-dynamic-behavior-on-an-npc/2550369 "2025-06-10T19:09:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Countsie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/countsie/32/1194632_2.png) [@Countsie](https://forums.unrealengine.com/u/Countsie)\
**Post date:** [June 10, 2025, 7:47pm UTC](https://forums.unrealengine.com/t/efficiently-running-dynamic-behavior-on-an-npc/2550369/2 "2025-06-10T19:47:31Z")

</div>

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:

> **[State Tree in Unreal Engine | Unreal Engine 5.6 Documentation | Epic...](https://dev.epicgames.com/documentation/en-us/unreal-engine/state-tree-in-unreal-engine)**
>
> StateTree is a general-purpose hierarchical state machine that combines the Selectors from behavior trees with States and Transitions from state machines.

> [@Tutorial: Your First 60 Minutes with StateTree](https://forums.unrealengine.com/t/tutorial-your-first-60-minutes-with-statetree/1901811):
>
> A practical guide to understanding and working with StateTree as it relates to AI. It covers key concepts, terminology, and execution flow for StateTree. This is accomplished while building a basic wildlife AI agent using the new StateTreeAIComponent. [https://dev.epicgames.com/community/learning/tutorials/lwnR/unreal-engine-your-first-60-minutes-with-statetree](https://dev.epicgames.com/community/learning/tutorials/lwnR/unreal-engine-your-first-60-minutes-with-statetree)

> **[Smart Objects in Unreal Engine | Unreal Engine 5.6 Documentation | Epic...](https://dev.epicgames.com/documentation/en-us/unreal-engine/smart-objects-in-unreal-engine)**
>
> Smart Objects represent a set of activities in the level that can be used through a reservation system.

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.

---

_[View the full topic](https://forums.unrealengine.com/t/efficiently-running-dynamic-behavior-on-an-npc/2550369)._
