Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Bolt not working in webgl asset bundle

Discussion in 'Visual Scripting' started by TechnicalArtist, Apr 30, 2021.

  1. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hi,

    please provide solution for how to work bolt in webgl asset bundle ?
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    This is what dev wrote to another user on the official Bolt Discord today:
    upload_2021-4-30_11-42-6.png

    ie you can't add new nodes that are not present in the main build because AoT PreBuild can't be run for AssetBundle content.
     
  3. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
  4. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Any workaround solution ?

    Unity will resolve this issue in future ?
     
  5. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    No. If you want new nodes, you need to ship a code update, not just an update bundle. It's a limit we can't go around, as nodes are ultimately code, and unused code is stripped during the build (see https://docs.unity3d.com/Manual/ManagedCodeStripping.html for details).

    The best we could do is to provide some kind of wizard allowing you to pick nodes you think you'll need in an asset bundle.
     
  6. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    thanks for answer.
    No we do not want to add additional nodes, we just want the graphs made in bolt work when they are loaded from asset bundle. We have one project for export asset bundle & other project for loading asset bundle.
     
  7. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    L2CPP scripting backend that WebGL uses code strips anything that is not used in the main build and disallows runtime code generation. Bolt runs using reflection, which is basically happening all at runtime. So by default Bolt does not run on L2CPP, which is where AoT Pre-Build comes into play. It scans all your created graphs and automatically generates stubs - placeholders that the L2CPP compiler will recognize and won't remove from the final build.

    AoT Pre-Build can't be run for Asset Bundles delivered later, it's an editor only functionality. So what theor is saying is that nodes that are not used in the main build and which don't have AoT stubs generated for them, won't run when delivered in an asset bundle. For example, if you've not used a Transform.position(set) node in the main build, but use it in an asset bundle graph - it won't work because L2CPP stripped that part of code away when the game was built.

    So in short, any nodes that are not used in the main build won't run in Asset Bundle graphs. This includes all the default Bolt nodes as well.
     
    Last edited: May 2, 2021
  8. theor-unity

    theor-unity

    Unity Technologies

    Joined:
    Feb 26, 2016
    Posts:
    188
    That's a perfect summary of the situation. Now maybe there's an actual but in your process, but we'll need more info to determine that
     
  9. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Thanks @PanthenEye & @theor-unity

    So if I copy all bolt macro in main app project & run AOT pre-build then will work ?
     
  10. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    @theor-unity Is there any method that generating link.xml for Visual Scripting graphs?
     
  11. Lokesh2022

    Lokesh2022

    Joined:
    May 8, 2021
    Posts:
    9
  12. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Out of context necro. The thread is about additional content delivered remotely with Asset Bundles without redoing the whole build from scratch. The linked issue does not address that.