0
\$\begingroup\$

I'm trying to load assets at runtime in Unity. I can load images this way: https://docs.unity3d.com/455/Documentation/ScriptReference/Texture2D.LoadImage.html

But how can I do the same with 3D assets? From what I read, loading .fbx/.obj and alike need importers. But importers are created by users, and support might be bad.

I read you can import using https://docs.unity3d.com/ScriptReference/WWW.html But that seems only to work with unity3D files

Or do I follow the wrong track? Is there another way to do this?

\$\endgroup\$
0
\$\begingroup\$

You'll need to create a new instance of the Mesh class and populate it with the vertex data that you read from the model file loaded at runtime. (Including vertex positions, triangle indices, and optionally texture coordinates, normals, tangents vertex colours, skinning weights, etc.)

That means your game needs to include logic (either an existing library that you include, or hand-rolled) to parse that model file format and read out the relevant data into the array types accepted by the Mesh class.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.