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 /
avatar image
0
Question by eitanwass · Oct 02, 2017 at 08:55 AM · prefabmodel

Question about prefabs

Hello Human Beings,

When I import a model into Unity I get the imported model not as perfab. When I make the model a prefab, does it copy its mesh or does it get it each time from the original copy of the model?

What I mean is, o I need to have both the model and the prefab? if so, why?

Thanks in advance, Ethan

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 Bunny83 · Oct 02, 2017 at 10:02 AM

You have to understand a fundamental concept here. In a Unity Project you have Assets. Assets is any kind of data that is stored on disk inside the Project View. When you import a model / mesh Unity actually creates a special read-only prefab asset in place of the model file. The imported mesh data, the bone structure, animations and other things that might be defined inside the model file get created as sub-assets below the root prefab. The prefab itself is almost like a normal prefab. So it's a serialized gameobject tree with some components.

Those components now will reference other assets like the imported "Mesh", the animations but also other standalone assets such as a "Material" asset.

The model asset is read only because the whole prefab got created by the model importer. When the model gets updated outside Untiy that prefab need to be reimported and might change.

When you create a new seperate prefab out of the imported model prefab, you basically create a copy of the gameobject structure and it's components. However those components will still reference the actual assets (like the Mesh, AnimationClips and Materials).

So yes, of course you have to keep the model asset in your project if you want to use that model. However keep in mind when you build your game Unity only includes "used" assets. So if you do not directly use the imported model prefab but only your own prefab, Unity will only include your prefab and the Mesh and Material assets which your prefab references.

You can simply check which asset are used by your prefab by doing a single left click onto the "Mesh" field of the MeshFilter component of your prefab (or of the SkinnedMeshRenderer depending if you have animations or not). Unity will try to "ping" / highlight the referenced object in the project view.

So creating 10 different prefabs of the same model won't duplicate the actual mesh data. All prefabs would reference the same Mesh object which "lives" as sub asset below the imported model prefab.

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 eitanwass · Oct 02, 2017 at 04:30 PM 0
Share

So it's referencing and not copying the model, right?

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

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

Models for game 1 Answer

Pre-Normalized cube model? 3 Answers

MMD How to export model and animations to Unity as 3rd person controller? 2 Answers

Importing a model without it becoming a prefab 3 Answers

Is there a way to make a model out of a prefab? 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