I have been trying to stream assetbundles from the Web Server which I own on one of my machines. The site is served by Apache Server application.
I have written the below two very basic script to serve this purpose:
I have a second script which uses this one and makes a model request as follows
The athena.unity3d is the assetbundle I have created correctly with my editor script. Anyway heres the problem. When I try to load this assetbundle from my file system it works correctly and the assetbundle pops up right away in the scene without problems.
However when I replace the URL with "http://www.mywebpage.com/athena.unity3d" I get an error which is:
Failed to load asset bundle UnityEngine.WWW:get_assetBundle() UnityEngine.WWW:get_assetBundle() ModelLoader:FixedUpdate() (at Assets\AssetBundleSerializationAssets\Scripts\Streaming\ModelLoader.cs:47)
Following this one I get a null pointer exception as the "mainAsset" field of the Assetbundle is null now. However this occurs within the "if" which controls whether if the download is finished. So if this is supposed to be a download error then shouldnt it be caught by the previous "if" which checks whether there was an error during streaming?
Can it be related to my Apache Server Configuration? Though I have uploaded my web player there as an html/unity3d file and I can access it on my browser without any problems. So I believe it is not the Apache Server which restricts access to those locations.
Anyone else had similar experience? Could you help?
Thanks a lot,
asked May 25 '10 at 03:43 PM
Ok got it solved... Shame on me for asking this question without removing Apache basic login/password authorization.
Though I dont know still if I can bypass it via web form and sending it over via WWW instance before requesting the file.
IF anyone know of a secure way of transmitting files via WWW instance I would really appreciate that.
answered Jun 01 '10 at 07:52 AM