• 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
2
Question by Thaliant · Oct 09, 2013 at 02:04 PM · prefabgitsource-control

What is the right way to update a Prefab in a team environment?

Currently we're using Unity Pro 4.1.5 and our project is checked into Git. I'm new to Unity but as I understand it, to make changes to a Prefab you drag it from the Project into your Scene (to instantiate a working copy), make changes in the Inspector, apply those changes back to the prefab and then remove the instance from your scene.

However, in even the most basic instance - changing the position of an embedded GameObject and pressing the Inspector's Apply Prefab button - the resulting changes in the .prefab file are extensive and unexpected. The diff contains hundreds of changed lines on child objects that I did not modify - things like "serializedVersion" being incremented, "m_Enabled" flipping from 0 to 1, "m_Script" attributes changing their 'type' from 1 to 3 and more.

The "m_Enabled" change is the most troubling - if the Prefab was setup to have disabled parts by default, why are they being instantiated as enabled and why are those changes percolating back to the Prefab when I did not press Apply on any child object except the one I repositioned? When the game is played, the Prefab is broken because all child components are enabled by default.

I've had to manually go line-by-line through the diff and revert the unnecessary changes leaving only one change to "m_LocalPosition" attribute before I commit. When I do this, the game plays as expected and the element I repositioned appears in the correct spot.

I feel like I must be missing something obvious - what do I need to do to prevent Unity from generating hundreds of unnecessary changes to the .prefab file? What is the right way to manage this on a team when it appears so easy to inadvertently change objects? Thanks in advance.

Comment
Add comment · Show 1
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 DannyB · Oct 09, 2013 at 02:43 PM 0
Share

I am also a bit curious about this. Up until now, I am just being very careful not to update any non-source object in two places at once, but in a larger $$anonymous$$m this can be impossible to enforce.

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Every Single Object "Missing Prefab" after Git Revert 1 Answer

Perforce Save Project checks out random prefabs 0 Answers

How do I restore my prefabs from my Git repository? 1 Answer

How to, git commit, the auto light bake setting ? 1 Answer

How to properly use git with a team? 3 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