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
4
Question by PsychoDuckArcade · Feb 06, 2015 at 01:00 AM · prefabupdatechangeinstance

Changing prefab doesn't update instances (in scene aswell as in other prefabs)..

After making a change to a prefab, how do I update all instances of that prefab with that change? It doesn't do it automatically or prompt me with anything. I know I can reset each instance individually, but that's tedious and repetitive if there's a lot of instances.

I know this questions been asked many times before, but I still haven't found an answer. How do I reset or at least update changes of all instances of a prefab at once? By instances I mean instances in scenes as well as references from other prefabs (prefabs childed to other prefabs).

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

3 Replies

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

Answer by carrollh · Feb 06, 2015 at 02:01 AM

As far as I can tell, once you set a prefab as the child of another prefab it stops being an instance of the original completely. Updating will only cause the parent prefab to change. I found this link http://framebunker.com/blog/poor-mans-nested-prefabs/ in this thread http://answers.unity3d.com/questions/320934/workarounds-for-nested-prefabs.html and they pretty much say the same. The first link has a working solution, using the IBakeable interface (which I didn't know existed until now).

Comment
Add comment · Show 3 · 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 PsychoDuckArcade · Feb 06, 2015 at 02:19 AM 0
Share

Yeah that just sort of clicked in my head "what if children prefabs become unreferenced and are ins$$anonymous$$d a completely new prefab?"

I was really afraid that would be the case.. :(

Thanks for the solution, I'll try it out. I was thinking I'd have to make my own editor script to find all objects of the same name as the prefab in the project and then replace them with the updated prefab.. Ugh that sounds like a bunch of issues waiting to happen.

avatar image carrollh · Feb 06, 2015 at 02:25 AM 0
Share

Yeah, sounds like a headache if you don't catch it early. The poor man's nested prefabs link basically has a script you can put on a prefab manager of sorts that seems to have gotten good reviews.

avatar image PsychoDuckArcade · Feb 06, 2015 at 03:40 AM 0
Share

Yeah its just kind of weird having to drag a script on every instance of a model and then dragging the original in the script every time i want to use a model.. The time spent navigating through folders is still a bit tedious and time consu$$anonymous$$g..

Still much better than nothing. I might try writing an editor script to somehow make it quicker to do.

I'm really surprised unity doesn't support nested prefabs already. I thought that was one of the big advantages of the prefab system.

I also found this which explains the dilemma in decent detail: https://josephstankowicz.wordpress.com/2013/05/23/the-perils-of-prefabs/

avatar image
0

Answer by James-Blaskett · Dec 01, 2017 at 08:41 AM

Catching it early is definitely key, but once you have caught it, there's a much simpler solution. Rather than adding prefabs as children to other objects, add null objects with a spawner script attached. The script can be as simple as the below (or as complicated as you want):

 public class Spawner : MonoBehaviour
 {
     public GameObject assignObjectInInspector;
 
     void Start()
     {
         GameObject myObject = Instantiate(assignObjectInInspector, transform.position, transform.rotation);
         myObject.transform.parent = gameObject.transform;
     }
 }

You can also put this script directly onto the parent and assign an array of spawners, whatever works best for you.

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
avatar image
0

Answer by vfxjex · Sep 12, 2019 at 02:53 AM

Select your prefab then open prefab assets Drag the prefab you want to update to its prefab inside your project folder.

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 Masiorama · Mar 19, 2020 at 09:52 AM 1
Share

I don't understand the part when you say to drag the prefab to its prefab in the project folder. I tried but it doesn't work.

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

23 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

Related Questions

Display one of prefab child 1 Answer

Prefab not changing variable's values 2 Answers

Changing the Variables of An Instanced Script 2 Answers

Why is instantiated animator prefabs are not working properly? 2 Answers

What process should I best use to properly create an updated copy of a Prefab? 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