Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Create a prefab, place a bunch of them and then changes to one affects all?

Discussion in 'Editor & General Support' started by Porto881, Jan 12, 2016.

  1. Porto881

    Porto881

    Joined:
    Jul 11, 2013
    Posts:
    74
    The topic pretty much describes my question. I´m building some stuff with probuilder that I want to use throughout my scene, the thing is that I want to complete my building before I texture it. My thought was to make prefabs of all the parts, copy these and build my building with these, and then texture one of them which will affect all the prefabs of the same type.

    I think I did that in an earlier project but it was a long time ago and I can´t really remember.
     
  2. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    Typically, yes, but it doesn't happen unless you click the "Apply" button on the inspector or select the "Apply Changes to Prefab" option in the GameObject menu.

    Probuilder might be a bit tricky though. The probuilder core code gets a little finicky when prefabbing things with pb_Entity scripts attached to them. This is because standard prefabs are pretty much all handled as static items until they are changed via the "Apply" method. Probuilder objects are a bit different in that they are dynamic until you compile your build, in which case probuilder runs its mesh combining routine to reduce draw calls.

    I've been doing some work with prefabs and probuilder specifically, and I haven't run into too many issues. In previous versions there were times when I would boot up unity and the probuilder prefab I was working on would be just a blank gameobject. Although I think this has been fixed in recent versions as I haven't had that issue again.

    So, in short, yes you can do it the way you're talking about. I would still test it out first in a controlled environment, just to make sure nothing gets wonky. Otherwise you should be fine.
     
  3. Porto881

    Porto881

    Joined:
    Jul 11, 2013
    Posts:
    74
    Oh that was it, hit apply! :D Totally forgot about that haha. I tried it out on a couple of prefabs and it looks like it´s working fine.

    Thank you!