Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rejinthomas · Aug 10, 2013 at 09:05 AM · webplayerassetsruntimedynamically

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

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rejinthomas · Aug 12, 2013 at 07:06 AM 0
Share

I search the above question all over the internet and no result found

Please anybody help me...

avatar image Joyrider · Aug 12, 2013 at 07:09 AM 0
Share

Like, what, these buildings would be non-existent at the moment of the creation of your webplayer. And you would want to be able to add new buildings that could be used by the webplayer?

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Joyrider · Aug 12, 2013 at 07:17 AM

I see two options

1/ ASSET BUNDLES

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.

2/ RUNTIME OBJECT GENERATION

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rejinthomas · Aug 12, 2013 at 09:20 AM 0
Share

Thanks for your reply

$$anonymous$$y is to create a building, then the user can add new features at runtime.

What I need is a GUI with the available items from a folder. Then when pressing an item in the GUI, I can create an instance of the item.

Hovering over the building, the item may be placed in specific locations. for instance, user may not place a door on the roof. Once user hovering over an appropriate location, he is allowed to release and place the texture or furniture.

Can I achieve that? Please Help. Thanks Advance

avatar image Joyrider · Aug 12, 2013 at 09:24 AM 0
Share

What kind of items in your folder?

Would you be the one to add the items to be accessible by the user, or do you want the user to add these items themselves?

avatar image
0

Answer by Bunny83 · Aug 12, 2013 at 09:31 AM

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.

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Joyrider · Aug 12, 2013 at 09:34 AM 0
Share

I was getting to that ;) But my guess is Assetbundels does what he needs.

avatar image rejinthomas · Aug 12, 2013 at 10:04 AM 0
Share

Not from user filesystem. I want my application to load stuffs that I already added in the webserver, so that user can use that.

$$anonymous$$y stuffs are furniture, texture etc

avatar image Joyrider · Aug 12, 2013 at 10:06 AM 0
Share

Than assetbundles is what you are looking for.

avatar image Bunny83 · Aug 12, 2013 at 10:39 AM 0
Share

Not really, if your assets are already in your game, like you said, you don't have to load them dynamically. Just Instantiate them

avatar image Joyrider · Aug 12, 2013 at 10:42 AM 0
Share

Hence my original comment on the question... it all depends if he wants to update his assets after generation of the webplayer or not. If not, than it is indeed fairly easy ;)

Show more comments
avatar image
0

Answer by Deepschalappatta · Aug 29, 2013 at 07:33 AM

Try this link. http://stackoverflow.com/questions/18438193/assetbundle-and-load-object-in-unity3d.

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);
         return;
     }
     
     var myLoadedAssetBundle = www.assetBundle;
     //print("hai"+myLoadedAssetBundle);
     var asset = myLoadedAssetBundle.mainAsset;
     //print("hai"+asset);
     Instantiate(asset);
       print("its me" +asset);
    }







Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SureshWipro · Dec 10, 2018 at 12:08 PM 0
Share

The Link is now not a valid which you provided. Please share some other links.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Loading of assets during runtime 0 Answers

what is the best way to implement minigames into my own full blown unity game. 0 Answers

Asset creator in Unity 2 Answers

How can I load 3d models(.obj, .fbx) dynamically in to unity scene after building it to WebGL ? 1 Answer

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges