Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a 3d model from URL in unity?

Tags:

unity3d

What is the best way to load a 3d model from a URL inside of unity at runtime. I have tried this obj importer http://wiki.unity3d.com/index.php?title=ObjImporter

But the mesh in not imported properly. What other options exist? Assetbundle needs a pro version and even that won't solve as I need to load a 3d model from url. Any suggestions?

like image 803
moleculeone Avatar asked Jul 19 '15 22:07

moleculeone


People also ask

How do I import a 3D model into Unity?

To import a 3D model into Unity you can drag a file into the project window. In the inspector > Model tab Unity supports importing models from most popular 3D applications.

Can you use a .FBX file in Unity?

Unity supports FBX files which you can export from many 3D modeling applications. Use these guidelines to help ensure the best results: Select what you want to export inside your 3D modeling application.


1 Answers

The way to go would be asset bundles. They are Unity's (proprietary) way to load prepackaged, compressed assets from a file or an URL. All asset bundles must be prepared and built in Unity Editor.

If you need a more general approach which loads a raw file format like fbx, obj, 3ds, collada, et cetera, you should use the Assimp library. Assimp library is written in C++ but there is a wrapper for C#.NET here.

There are also wrappers for Unity like this Unity Assimp being free but quite outdated. The Asset Store though is packed with format specific importers including this free OBJ importer.

2021 update

Unity now also has Addressables which are an evolution of the aforementioned Asset Bundles. In a sentence, Addressables are memory managed, asynchronously loadable resources that can be loaded from local or remote end points.

like image 158
SteakOverflow Avatar answered Oct 12 '22 19:10

SteakOverflow