Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Showoffz · Mar 24, 2016 at 02:24 PM · runtime3d models

Adding new 3D objects during runtime/ after build

Hello

I have bunch of 3D models that are made into prefabs by hand, so that algorithm could automatically place them into realistic positions (on ground, next to wall, on wall etc). And I was thinking how could I give user a way to add these objects on their own if they have only the built version. If I'm right, it can be done using AssetBundle. But I am now to the whole Unity so I am not sure.

And if I will be able to use AssetBundle for that, can I let user to create the .prefab files themselves and then add the to a right directory so that my program could automatically import from there?

Or do I have to automate .prefab creation so that the user has to only place a desired 3D model in the right folder

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by RyanAchtenSoma · Mar 24, 2016 at 10:49 PM

Pretty sure you can't create prefabs at runtime due to their creation relying on editor functionality (not included in builds). You can however import the mesh of files at runtime in the form of .fbx or .obj files.

Not sure about using Asset Bundles, but a quick way of parsing models at runtime that I use is via the ObjReader which is super quick due to running off an external .dll (Unity's built in .obj parser is much too slow for my taste). Pretty sure ObjReader can parse multiple objects at once so you could definitely create a system like you describe above.

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 Showoffz · Mar 25, 2016 at 08:17 AM 0
Share

@RyanAchtenSoma, thank you for your reply.

Prefab allows me to create a template of an item. And later use that template to generate random number of instances of it and they all behave the same (lets say... have tags "on wall" so all of them will be generated on walls).

If I understand ObjReader description right. It imports .fbx files into game and makes them into GameObjects. Then how can I add these same prefab tags to these new GameObjects?

avatar image RyanAchtenSoma Showoffz · Mar 25, 2016 at 11:26 AM 0
Share

Yeah as mentioned above, pretty sure creating prefabs isn't functionality supported by builds as it is reliant on the the editor environment.

You could store the 'tag' information you mention in an xml schema of some description along with the model location on you local system, texture location, transform coordinates etc etc to sort of replicate the role of a prefab (obviously this won't be optimised the way a prefab is though). To add a 'tag' in the Unity sense you can just go gameObject.tag = "tagName"

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

51 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 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 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

Importing new 3D models without editor 0 Answers

Change object Color during runtime 0 Answers

Help (reloading a level) 0 Answers

Issues with video player coroutine 2 Answers

reverberation time and microphone dB value visualisation 0 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