Move Ai behaviours outside of hardcoded C# Script?

Right now i have ai scripts i attach to my navmesh agents.

Theyr pretty standard - if x happens do y. But its hard to extend and visualize the behaviors links because its all in code, and increasingly nested messy code as i add more behaviours and if/else starements.

I really like how in Mecanim you can just add and delete nodes. In fact i like nodes in general.

Ive tried things like Bolt, but its deep integration into Unity scared me. But i also see things like Xnode and wonder if they would work https://assetstore.unity.com/packages/tools/visual-scripting/xnode-104276 (i am checking it out)

Im wondering if anyone knows a lightweight way to combine nodes with a C# Script so i can extend behaviors? Or maybe the only solutions are heavier and more integrated behavior tree assets?

Good news, you can just sort of…use Mecanim.
https://medium.com/the-unity-developers-handbook/dont-re-invent-finite-state-machines-how-to-repurpose-unity-s-animator-7c6c421e5785

1 Like

This sound very neat - i’m going to look into it, thanks for turning me on to it.