Hi i a very new to unity, I have a problem with instantiate in web build.
I cannot load an object in web player. When i try to load it in editor it loads perfectly.
This is the code that i use
if (Application.isEditor) {
assetPath = "file:///" + Application.streamingAssetsPath + "/" + thumb + goniakos + "_" + width + length + ".unity3d";
var eee = Application.streamingAssetsPath + "/" + thumb + goniakos + "_" + width + length + ".unity3d";
}
else {
message += " isNotEditor";
assetPath = Application.dataPath + "/StreamingAssets" + "/" + thumb + goniakos + "_" + width + length + ".unity3d";
eee = Application.dataPath + "/StreamingAssets" + "/" + thumb + goniakos + "_" + width + length + ".unity3d";
}
message += assetPath;
var www = new WWW(assetPath);
var instance : GameObject = Instantiate(www.assetBundle.mainAsset);
message += " isNotEditor";
thumb, width, and length are variables
When i print the variable assetPath its a valid http address but the object doesent load
Thank you
↧