Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Aristides 1 · Apr 10, 2011 at 08:22 PM · prefabupdateduplicatecopy

What process should I best use to properly create an updated copy of a Prefab?

This should be elementary. I have an existing prefab which contains about seven components, one of which is a script.

What I'd like to do is create for another scene, a very similar prefab, which contains a different script.

The process I'm using thus far fails in a very specific way. Using the editor, I place in the hierarchy a new game object which is an instance of the original prefab. I then alter its components to give the desired characteristics. I place the new script into the object, and assign a target transform which that new script requires. All is well up to this point.

Then I use Asset-> Create-> Prefab to make a new blank Prefab to which I want to assign the characteristics of the new object. I drag the object from Hierarchy into the Prefab. All components transfer correctly except for one item.

In the resulting prefab, the transform variable of the script is now "None", and of course, being a Prefab, it cannot be assigned manually.

I'm at wits' end. Suggestions welcome.

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 · Apr 10, 2011 at 08:52 PM

I'm not sure if i get that right... :D
So you have a script attached and this script has a public transform variable? What is assigned to that variable? or do you talk about the transform component of your prefab?

I also don't understand you last sentence. You can set variables of a prefab manually. Just select the prefab in the project view and edit it in the inspector. The only limitation is that you can only access the first two layers of the prefab.

The second way to "edit" a prefab is to drag it into a scene (create an instance) and change what you want. If you're done, just click the "apply" button at the top of the inspector to apply the changes to your prefab.

Maybe post a screenshot of your inspector to show what exactly you meant. Just edit your question if you want to change/add something.

Good luck

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 Aristides 1 · Apr 11, 2011 at 04:17 AM 0
Share

Sorry if I was unclear. The "transform" I mention is a public script variable.

I've tried your approach to create an instance and "Apply" the change in the inspector. Unfortunately, this also fails. The prefab was not changed, though of course the instance was.

Could you explain what you mean by "the first two layers" of the prefab? I've attempted to edit this prefab directly in the inspector to no avail.

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

No one has followed this question yet.

Related Questions

Duplicate prefab and all its variants to new prefab with new variants 0 Answers

Placing Prefabs in Prefabs. 9 Answers

Possible Unity Glitch. A few lines of code erasing prefab data. 1 Answer

How should I structure this in Unity? 1 Answer

duplicate prefab: disconnecting 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