docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Create an action node with generative AI

    To create an action using the generative artificial intelligence (AI) feature of Muse Behavior, perform the following steps:

    1. Right-click an empty area of the Muse Behavior graph editor and select Create new > Action.

      The New Action window appears.

    2. Enter a name for the new action. For example, Rotate Towards.

    3. Select a category from the Category list to sort the new node into a specific subgroup in the menu. Alternatively, you can leave it with the default Action value to make it available at the root of the Action node list.

    4. Select Next.

    5. Type a description (including variable, if any) of what the node might do. For example, Self rotates towards Target over X seconds.

      Note that Muse Behavior lists all the elements specified in the description on the window as variables along with a list of data types. If you have already created and defined the variable on the Blackboard, Muse Behavior identifies it and uses the relevant data type.

      Action description

    6. Select the appropriate data type from the list for each variable.

    7. Select Use Generative AI.

    8. Specify more information about how the node might work. For example, Over X seconds, have self rotate towards the target. Return Success when the rotation is completed..

      Action description

    9. Select Create with AI.

      Muse Behavior generates the C# code for the action and directs you to save it.

    10. Once saved, Muse Behavior opens the code in an Integrated Development Environment (IDE), for example, Visual Studio.

      The code displays a statutory legal message at the top indicating that Muse Behavior generative AI tool has generated the code.

      Legal message

      The new node appears on the Muse Behavior graph editor.

      New node

    11. Place the node at the relevant position in the behavior graph by performing the following steps:

      1. Click the node you want to move.
      2. Drag the node to the relevant position in the behavior graph.
      3. Release the mouse button to drop the node into place.
    12. To link the variable to the link field, click the link icon in the new node and select the relevant variable from the list.

    You're now ready to use the new node in the behavior graph.

    Note

    You can try to generate a branch first to check the behavior generated by the AI, including any placeholder nodes. Then, create nodes from these placeholder nodes. This method pre-fills the placeholder nodes with information such as name, story, and variables, making it easier to customize them instead of starting from scratch.

    Additional resources

    • Create a branch using generative AI
    • Placeholder node in a behavior graph
    • Best practices for using generative AI
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)