Quantcast
Channel: Questions in topic: "loadassetatpath"
Viewing all articles
Browse latest Browse all 62

I cannot load an asset in web player with instantiate

$
0
0
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

Viewing all articles
Browse latest Browse all 62

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>