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.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Asset bundle prefab with sprite renderer issues

Discussion in 'Asset Bundles' started by drulz, Mar 25, 2022.

  1. drulz


    Feb 21, 2015
    I created an asset bundle which contains a prefab from an image sprite, this asset bundle will be loaded remotely.
    to make sense, ofcourse the prefab and the original image sprite will be deleted in the project itself to save the game size.

    But deleting the asset and loading the asset bundle it gives us the error
    Could not produce class with ID 212.
    This could be caused by a class being stripped from the build even though it is needed. Try disabling 'Strip Engine Code' in Player Settings."

    Doesnt this defeat the purpose of having an asset bundle in the first place? why in the hell does the original Sprites needs to be available IN the build where in the purpose of the build is to save loading time by reducing the size?

    im getting the error in WebGL build
  2. TobyKaos


    Mar 4, 2015
    If you use assetbundles then the sprite will not be included in your build. And then when you load assetBundles then the sprite will appear without error.
    Do not erase it in your project.

    But if you include your sprite in Resources folder then I assume it will also be included. Put it in another naming folder.