Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How do I execute ScriptGraphAsset from ScriptableObject?

Discussion in 'Visual Scripting' started by nrvllrgrs, Oct 24, 2022.

  1. nrvllrgrs


    Jan 12, 2010
    I'm attempting to create a Utility AI. I have a Brain ScriptableObject, which has a list of Actions. I would like to let designers define an Action's behavior via a ScriptGraphAsset, which implements a specific CustomEvent (i.e. an interface of sorts). This architecture allows them to explore various types of actions without engineering becoming a bottleneck. But that said, I have no idea how to execute a ScriptGraphAsset from a ScriptableObject; nor do I have an idea how to start extending the framework to do so.

    In effect, I'm trying to allow designers to define static methods in visual script.
  2. PanthenEye


    Oct 14, 2013
    You can trigger Custom Events from C# code and you can implement custom nodes, but that's pretty much as far as it goes. There's no way of executing ScriptGraph without the ScriptMachine component so it has to exist within Hierarchy somewhere. This incarnation of the tool was designed by a solo developer for the Asset Store users, who are also non-coders and Unity newbies. Data driven workflows were never really considered, and the API wasn't even documented pre-Unity acquisition.
    REDACT3D_ likes this.