Create Asset bundle in unity3d

In this article, I will explain how to create asset bundle in unity3d. Please refer my blog Load asset bundle in unity3d to know about how to download and load asset bundle in unity project.

Tools/software used in this Demo: Unity 5.3.2f1 Personal edition (64 bit)

So let’s see how to create an asset bundle in unit3d.

Create Asset Bundle in unity3d – step by step guide

Step 1

Select the asset that you want to add in asset bundle. In the bottom of Inspector pane, click on asset bundle field.

Create Asset bundle in unity3d -1

Step 2

Click on the new if you want to add your asset in new asset bundle or select the already named asset bundle. You will get the entire named asset bundle over here.

You can add multiple assets to a single asset bundle name.

Create Asset bundle in unity3d -2

Step 3

Write the name of the asset bundle and hit ENTER key. Then you will see name of your asset bundle in the AssetBundle field.

Create Asset bundle in unity3d-3

Step 4

Add Editor Folder in Assets folder and add below script in this folder.  Asset bundles are platform (android, iOS etc) dependent; so generate asset bundle accordingly. You can select platform by setting BuildTarget argument.  For below code, assets bundles will be generated in “Assets/AssetBundles” folder.

Step 5

Click on BuildAssetBundles (Assets -> BuildAssetBundles) to generate asset bundles.

Create Asset bundles in unity3d-4

Once you will click on BuildAssetBundle as shown in above image, asset bundles will be generated in AssetBundles directory. Make sure that you have created AssetBundles directory in Assets folder, before generating asset bundles.

Once the Asset Bundles will be created, you can load them in your projects using WWW class. Please refer my article Load Asset Bundle in unity3d for more details.

Hope you get an idea about how to create asset bundle in unity3d. Post your comments for feedback and queries. Thanks for reading.

Share Button
The following two tabs change content below.
Gyanendu Shekhar is a technology enthusiast. He loves to learn new technologies. His area of interest includes Microsoft technologies, Augmented reality, Virtual reality, unity3d and android development.

Gyanendu Shekhar

Gyanendu Shekhar is a technology enthusiast. He loves to learn new technologies. His area of interest includes Microsoft technologies, Augmented reality, Virtual reality, unity3d and android development.

3 thoughts on “Create Asset bundle in unity3d

Leave a Reply

Your email address will not be published. Required fields are marked *