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
1
Question by Mazer83 · Oct 11, 2017 at 08:28 PM · prefabscomponentssource-control

What files are responsible for script components on prefabs?

When I do an SVN commit of my changes, then do a test checkout of my Unity project, some of my prefabs will be missing their script component.

Like, say I have a prefab called: SystemCanvas, which is parent to a button called: SystemButton, and that has a component called: "SystemButton".

The "SystemButton" will be missing.

alt text

I've noticed this problem on a lot of prefabs, and I don't know why this is happening.

I have the SystemCanvas.prefab, and SystemCanvas.prefab.meta comitted already, so I must be missing some other file.

Edit: I already committed SystemButton.cs.

missing-nothing-selected.png (10.7 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by ghostmode · Oct 12, 2017 at 10:13 PM

Another idea: Be prepared to do a hard revert on your svn, or use a copy of your project and a new svn repo to try this. Set 'Asset Serialization Mode' to 'Force Text' (Edit/Project Settings/Editor)

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 Mazer83 · Oct 18, 2017 at 07:27 PM 1
Share

Thanks! If you post this as an answer, I'll mark it as the solution.

avatar image ghostmode Mazer83 · Oct 18, 2017 at 07:36 PM 0
Share

Done! Glad you got it working.

avatar image
1

Answer by ghostmode · Oct 11, 2017 at 08:56 PM

You also need to check in the "SystemButton.cs" file, this is the component you created and attached to your button.

Edit: And also "SystemButton.cs.meta" as @Bunny83 mentions below.

Comment
Add comment · Show 8 · 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 Mazer83 · Oct 11, 2017 at 09:26 PM 0
Share

I already did that. It can be re-added on the client side, it's just not obvious for someone else working on the project which script is supposed to be there, and this happens for a lot of prefabs.

avatar image Bunny83 Mazer83 · Oct 11, 2017 at 09:47 PM 1
Share

$$anonymous$$aybe you forget the meta file of the script? Every asset in your project should have a corresponding meta file.

avatar image Mazer83 Bunny83 · Oct 12, 2017 at 02:45 PM 0
Share

I already did that as well.

avatar image ghostmode Mazer83 · Oct 11, 2017 at 10:01 PM 0
Share

You can't quite 're-add' script files and have your references work, as Unity doesn't use the file name to refer to components, but rather a guid that is assigned when a new file is created/imported. This is stored in the the corresponding meta file mentioned by Bunny.

avatar image Mazer83 ghostmode · Oct 12, 2017 at 02:56 PM 0
Share

systemButton.cs can be added as a component to SystemButton on a checked out copy of the project and it will work. It's just too much of a hassle to have to tell anyone who works with me which prefabs they have to fix after checking out the project, and again when I'm updating and getting their work.

avatar image NoseKills Mazer83 · Oct 12, 2017 at 06:11 AM 1
Share

There are guides about using version control with unity that mention things you might or might not have already done.

avatar image Mazer83 NoseKills · Oct 12, 2017 at 06:09 PM 0
Share

Thanks Nose, I learned something useful from that, but unfortunately, it didn't pertain to this problem.

Show more comments

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

74 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

Related Questions

Animated character FBX workflow question 1 Answer

How to add components to all spawned prefabs ? 0 Answers

can you access a script in a prefab and change its value 1 Answer

can I update prefab Assets with new 3D files without resetting their components? 2 Answers

Why are Prefabs now storing a list of modifications? 1 Answer


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