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
2
Question by Nanako · Nov 04, 2014 at 10:50 PM · prefabmodelinstance

Is there a quick way to replace an object with a prefab instance?

Hi all. I've messed up slightly.

I've placed many copies of a model, and then turned one of them into a prefab. What i have now is a single instance of that prefab, and a bunch of identical instances of the model the prefab is based on.

What i'd like to do is turn all those instances of the model, into instances of the prefab.

I can do this by just noting down the transforms, manually deleting them, dragging in a prefab instance, and re-entering the position/rotation. But that would be time consuming to do many times over. I'm wondering if there's some better way to do this en-masse, or even just to speed up the process per-instance.

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 AlwaysSunny · Nov 04, 2014 at 10:55 PM 1
Share

You could write an editor script to help! To my knowledge, there's no built-in way to accomplish this with great ease. If it saves work, write a script - if it'd take less work to change each one manually, do that.

1 Reply

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

Answer by MrSoad · Nov 04, 2014 at 11:20 PM

Try this, it worked for me when I did this ages ago.

1) Create a new prefab(A).

2) Rename the one that is a prefab to something different(B). Delete from scene after doing this.

3) Drag each of your objects from the hierarchy window onto this new prefab(A), one at a time. The order in the Hierarchy window will change as you do so be careful to take this into account(as these are not currently prefabs then you can use the text color to tell which ones you have done). Yes to replace for each one when the box pops up.

4) When you have associated all these objects with the new prefab(A) drag the original prefab(B) object onto this prefab(A) and again click yes.

5) Now with a bit of luck they should all be associated to one prefab(A) whilst keeping their transform position in the scene. To test if you have got them all change the scale of the prefab, if they all adjust then you have got them all.

This will reset scale, however it will at least keep both the position and rotation :)

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

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

28 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

Related Questions

Models for game 1 Answer

How can I set the material on an instance after creating it? 1 Answer

Understanding prefab updating its instances 1 Answer

Is there a way to make a model out of a prefab? 0 Answers

AssetDatabase.AddObjectToAsset is not persistent? 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