docs.unity3d.com
    Show / Hide Table of Contents

    Use Visual Scripting with Unity Cloud Build

    At build time, Unity removes any code that isn't used by a project to reduce build size. This can cause problems with Visual Scripting because Unity can remove code that's necessary for Script Graphs to run in a project.

    For versions 1.7.x, Visual Scripting generates an AotStubs.cs file, which stores the Unity APIs that graphs use. With the AotStubs.cs file, Unity doesn't remove any Unity APIs used in a graph from a build. You can generate this file when you create a build of a project.

    Builds through Unity Cloud Build can fail because Cloud Build prevents domain reload between the prebuild and build phases of the project. Without a domain reload, the build doesn't include the generated AotStubs.cs file. For more information about domain reload, see Domain Reloading in the Unity User Manual.

    To build a Visual Scripting project with Cloud Build, do the following:

    1. Build the project locally for your desired platform.
      For more information on how to build a project, see the relevant section for each platform in Platform development in the User Manual.

    2. After the build, do one of the following:

      • Open the project files in the system file explorer.
      • Open the Project window in the Unity Editor.
    3. In the project files, go to Assets > Unity.VisualScripting.Generated > VisualScripting.Core.

    4. Locate the AotStubs.cs file.

    5. Add the AotStubs.cs file to your source control system.

    Your Cloud Build settings might automatically trigger a new build of the project after you commit the AotStubs.cs file. For more information about version control systems and Cloud Build, see Unity Cloud Build in the User Manual.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023