how to add models dynamically at runtime in unity web output?

I am new to unity. I want to know how to add models to my building from a folder at runtime.
Please Help. Thanks Advance

I see two options


You could use Unity’s AssetBundles and Building AssetBundles

It would require you to have Unity Pro though; and is the only way to stream new ready-to-be-used models into Unity (scripts are not supported, so all your logic has to be in your original player).

Here is also an interesting read for how to use them for web builds in order to avoid the 50Mb (or otherwise indicated) cache size limit.

You can either have one assetbundle with all your assets

or a textfile listing all your objects on a server, and have a seperate assetbundle for each object, that you can download according to what the user wants to access.
Avoiding to have to download everything at once.


There is one other option, but I do not think that is what you have in mind.
The second possibility would be to download a textasset that contains all data relevent to the creation of your model, and to construct the model yourself. So this is a little more complicated. After which you could download the textures you need for the model.
Note that all the shaders you would use, would need to be already in your original export as well.

The webplayer can’t access any folder from the users filesystem for security reasons. There is no way around that. You have to load any stuff from your webserver where your game/application is hosted.

Try this link.

instead of caheload.js you just try this code

 #pragma strict
  function Start ()
var www = WWW.LoadFromCacheOrDownload ("file://C:/wamp/www/object/monkey.unity3d",4.2);
	yield www;
 //  print("hai"+www);
	if (!String.IsNullOrEmpty(www.error))
		Debug.Log (www.error);
	var myLoadedAssetBundle = www.assetBundle;
	var asset = myLoadedAssetBundle.mainAsset;
      print("its me" +asset);