Search Unity

Known Issues

Discussion in 'Prefabs' started by runevision, Jun 18, 2018.

  1. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    Here's a list of known issues to be aware of. (Minor and cosmetic bugs are not listed.) We will keep the list updated.

    [FIXED] Missing references and incorrect values when Prefabs have scripts that don't compile
    There is a known issue that causes Prefab instance property values to be wrong. This includes broken references. The issue appears if there are scripts that have compile errors when Prefabs are imported. The current workaround is to fix script errors and then do a reimport. Either reimport the affected Prefabs or do a Reimport All.

    [FIXED] Prefab Mode in Play Mode may cause physics issues
    If you edit a Prefab with Rigidbodies, colliders, or other Physics components on it (2D or 3D) in Prefab Mode, and you go into Play Mode, the Prefab may incorrectly affect the gameplay of the game in Play Mode, or the Prefab may incorrectly be modified by Play Mode physics simulation and have those modifications stay. There is a planned fix to this which is not part of the Preview build.
     
    Last edited: Jun 22, 2018
    AntonioModer likes this.
  2. Robert-Acksel

    Robert-Acksel

    Joined:
    Aug 7, 2012
    Posts:
    13
    First thing which i saw is that i have prefabs which store references to scriptable objects. After first opening my project i saw that all instances of those prefabs do not have their references to the scriptable objects set (even though this was not a modified property). The missing references where also not listed in the modified properties view of this instance of the prefab (which is expected since there is no modification in that instance).

    What i did to overcome the problem is to open the prefab and then set the reference to the scriptable object to a different reference and right back to the reference which where meant to be set.
    It fixed the issue for me and i have no problems after i did this so far.
    Except that the editor is freezing sometimes (its an exp build ;) ).
     
  3. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    Were your Prefab instances by any chance disconnected (before opening with the Prefab builds)? Or did you store your Scriptable Object assets inside the Prefab assets?

    If you have a backup of your project in its original state prior to opening with the Improved Prefabs build, we'd very much like that along with a bug report with repro steps. We've seen some issues occasionally with missing references upon upgrading projects, but haven't been able to narrow down yet what exactly cause it.
     
  4. Robert-Acksel

    Robert-Acksel

    Joined:
    Aug 7, 2012
    Posts:
    13
    For both questions the answer is no.
    A hint could be that the scriptable objects, which have been referenced in the prefabs, are stored themselves in a scriptable object (AssetDatabase.AddObjectToAsset).

    DatabaseScriptableObject
    ->ItemScriptableObject
    ->ItemScriptableObject
    ->ItemScriptableObject

    I think i should be able to recreate the prior state. I would need to reduce the project size drastically since i have tons of stuff in it as it is my playground project. And since i am at Unite i might not have too much time to do it in the next days.
     
  5. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    465
    Hi @Robert-Acksel

    This is an issue that showed up late that we did not manage to get fixed before shipping, once fixed we will update the build.

    Issue is that we try to remap pointers on MonoBehaviour inside Prefabs to point at assets in the Library folder instead of the Assets folder.

    Unfortunately we were a little too aggressive and remapped pointer to assets that actually only live in the Assets folder, so there is no Library folder object to remap to. This will happen to added assets as you discovered but also materials and scriptable objects.

    Does that make sense?

    Fix should come soon.
     
    NeatWolf likes this.
  6. Robert-Acksel

    Robert-Acksel

    Joined:
    Aug 7, 2012
    Posts:
    13
    Hey @SteenLund

    without knowing too much about how the library stuff works but from what i understood, i think this makes perfect sense exactly then when a project is imported (or upgraded which is essentially is an import for at least some assets).

    If wanted i can offer to retest the import/upgrade when the new build is available.

    Thx you all for great work. Keep on with it.
     
  7. JakobSchouJensen

    JakobSchouJensen

    Unity Technologies

    Joined:
    Jan 24, 2017
    Posts:
    5
    There is a known issue that causes prefab instance property values to be wrong. This includes broken references. The issue appears if there are scripts that have compile errors when prefabs are imported.

    The current workaround is to fix script errors and then do a reimport. Either reimport the affected prefabs or do a reimport all.
     
  8. las_nsc

    las_nsc

    Joined:
    May 29, 2018
    Posts:
    10
    We've been using this since it was released, and we love it but have encountered a few issues:
    • Transforms. They are frequently detected as overrides when no values are different. This may be a bigger rounding error issue within unity as a whole (90.000001 degrees really aggravates my OCD).
    • Overrides list. It would be better if modified objects appeared in bold, like the modified values, so you don't have to hover over everything to see the component changes. Also, if you make a revert objects in the tree below are collapsed (It's OK if you do it bottom to top). Would be nice to be able to revert/apply multiple changes at once too (not all).
    • Missing references. If you remove an object that has a component added to it in a derived prefab, it causes unity to crash. As a way to recover, I recommend that a dummy object is added and the components appended to that instead (similar to the missing prefabs).
    • Inserting/swapping the base. One missing feature that would really help is to insert a variant prefab above the current prefab (derived from the original base), or to swap the base for a compatible variant. Several times I've thought "this element should be shared through a variant" but I then have to completely restructure the existing prefabs or start from scratch to achieve that.
    • Stripping out redundant overrides. It would be nice to have a quick way to detect overrides whose value is the same as the base (maybe the base gets updated, and the derived prefabs all have the same change), they could be displayed in italics or something to indicate they're redundant, and then an extra button to 'remove redundant changes'.
    • Diff and Merge. We've had some problems with merging, because the transforms at the start of the file seem to change order each time the file is modified. The rest of the file actually seems to be better for merging as it mirrors the structure of the object more than before.

    Is there any chance of a patch to solve some of these issues any time soon?
    It would be nice if this build was available through the hub too.
     
    Last edited: Jul 10, 2018
  9. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    Are you seeing this only in the Improved Prefabs build? There are some issues with floating point errors getting introduced for example when duplicating objects, but it's an old issue not specific to that build.

    Feature request noted.

    We can't repro that here. Do you have a case number with repro project so we can test with your exact setup?

    See this Unite talk about how to insert a base:

    There's no good way to swap a base, even if they are seemingly "compatible". Since the objects in the different base has different IDs you would lose references. It might however be possible to create user scripts that handle it well enough for certain purposes, but no general-purpose robust solution.

    Feature request noted. (It shouldn't be too hard in the mean time to create a script that reverts all such overrides for e.g. a single object or an entire Prefab.)

    Is that specific to this build? In any case, if you have clear repro steps we'd appreciate a bug report.

    The Improved Prefab features will be part of the Unity 2018.3 release. We won't be implementing new features for that release, but will work on bug fixes throughout the alpha and beta cycle.
     
  10. las_nsc

    las_nsc

    Joined:
    May 29, 2018
    Posts:
    10
    Thanks for the reply

    The 90.000001 issue is an old bug, yes. I am seeing a list of transforms for various objects in the overrides list which have no changed values. My best guess is that this is down to the rounding error when comparing.

    I haven't produced a case, but effectively the steps are:
    • create a prefab base with a game object (save it)
    • create a variant of that base prefab
    • add a component to the game object in the base (save it)
    • delete the game object in the base
    I've tested this in isolation and it causes a crash when saving the delete.

    That's cool. I'm guessing its from here I need to watch? (some bookmarks in the video description would be handy). It was uploaded 2 days after my post though, so I couldn't have seen it. I was thinking of changing the base to a variant of the same base rather than a completely different prefab, so all the object IDs should still exist (except for deleted components - could something similar be done for gameobjects?)

    EDIT: I tried it (not obvious at all), and it basically makes the current prefab the base then adds an empty variant in the place of the initial prefab. It might have its uses, but what I wanted is to create an empty prefab base so I can 'apply' things down into it and re-use that with other prefabs. Effectively Animals are initially equivalent to Cats until you copy out (and then delete in the base) things in Animals that should be unique to cats, but it seems more useful to me to leave Cats as they are and make Animals empty until things from Cats are 'applied' to Animals. I refer to 'applying' as pushing down, but there is no way to 'pull up' things from the base, making the existing mechanism more difficult to use.

    I haven't looked into the scripting side of the improved prefabs. Is that in the video too?

    It's specific. I worked out the exact cause. If you apply a change to a prefab from a derived one or the scene, the file structure is maintained correctly. If you save the prefab in isolation mode, all the transforms are pulled up to the top. This should be an easy fix (that would be really helpful to get ASAP). This also happens to the scene, but there's no way to 'apply' something externally to a scene, so it just constantly shuffles the transforms at the top.

    So does that mean we'll get a patched preview build soon? (Maybe through the hub?)

    Thanks again.
     
    Last edited: Jul 24, 2018
  11. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    That's what I tried as well. Without a repro project, I can only assume it has been fixed here.

    Yeah, I've considered if some 'Extract' feature could be implemented which is the reverse of applying added components and GameObjects. Won't be in the initial release though.

    No, we don't have much learning materials for it, but a good place to start looking is PrefabUtility. There's methods there for getting all overrides and other methods for reverting an override.

    Could you submit a bug report and post the case number here? We can't keep track of bugs via the forums.

    Right now we have no plans for that as it would take resources away from fixing issues for the proper release in 2018.3.
     
  12. BazookasZerreth

    BazookasZerreth

    Joined:
    Dec 8, 2016
    Posts:
    17
    Rect Transforms have issues with the new Prefab System (as does the 3D transform):
    When creating a Prefab variant (2D), the rect transform will not save on the variant position, bounds, anchor, pivot, rotation properties.

    1) The prefab will not revert to the rect transform values of the original prefab when overridden in the scene and requesting a revert. So a size of 400x600 can be specified in the prefab while it has 800x300 in the scene without unity registering that as a override on the prefab or being able to revert to the values set in the prefab.

    2) Changes to Variants on the rect transform property (when opening the prefab variant) will not result in a overridden property. The variant will constantly revert back to the rect transform values it had when creating the variant (could be the rect transform values it had in the scene at the time). And thus has no relation not the prefab rect transforms it is based on.

    The same goes for position & rotation transforms on a 3D GameObject. WIth the same weird behavior with the variant creation keeping its values when the variant was created.

    I understand that this is because it used to be very easy to screw these values up with the apply to prefab of olden days. But in the new system of explicitly opening up prefabs and adding overrides (highlighted in blue and bold) the transforms and rect transforms should really be marked as an override just like everything else.
     
    Last edited: Jul 30, 2018
  13. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    It's unclear to me if you're talking about these overrides only inside Variants or also in scenes. The Variants part of it is discussed here: https://forum.unity.com/threads/bug...-base-prefab-arent-propagated-variant.542161/
     
  14. las_nsc

    las_nsc

    Joined:
    May 29, 2018
    Posts:
    10
    Case 1066012. It only applies to prefab variants and the scene, not base prefabs.
    I understand, but that sucks because the missing references bug I mentioned (that it sounds like you fixed already) is wasting a lot of our time with unity crashing with no explanation of the cause, even in the crash log.
     
    runevision likes this.
  15. las_nsc

    las_nsc

    Joined:
    May 29, 2018
    Posts:
    10
    I'm not sure if this is what you're referring to, but Transforms (except for scale) on the root of prefabs are not considered overridden in instances. This makes sense, as if you have a dozen enemies and revert their overrides, you don't want them all to stand on the same spot. It might be nice if transforms on the root of prefabs had position and rotation disabled (or always reset to zero when saved) to indicate that they are meaningless. They do affect initial Transform when placed, but personally I never find this to be useful.

    However, I have found that Rect Transforms are prone to being falsely identified as overrides more so than 3D transforms. The rounding errors are so large that it even appears as an override (in bold), but applying it doesn't work.
     
  16. BazookasZerreth

    BazookasZerreth

    Joined:
    Dec 8, 2016
    Posts:
    17
    I've formulated a better response in the topic that Runevision suggested.
     
  17. las_nsc

    las_nsc

    Joined:
    May 29, 2018
    Posts:
    10
    I believe I've found several bugs with light probes:
    - applying changes to a light probe group inside a prefab causes unity to repeatedly save in an endless loop (it saves, but you have to force restart the application)
    - editing light probes in prefab mode retains the unmodified mesh from the scene until it is saved.
    - editing light probes in prefab mode includes other light probe groups in its mesh from the scene it is used in.

    also, I don't think it's related to prefabs (not sure), but I can't select multiple probes in the scene using modifier keys (shift/ctrl) and the inspector tab has to be docked the in the first GUI pane for editing probes to work (I believe this is a know issue).

    It's pretty easy to reproduce, do I need to include an example scene and a bug report?
     
    Last edited: Aug 23, 2018
    hippocoder likes this.
  18. gawoon

    gawoon

    Joined:
    Dec 11, 2017
    Posts:
    3
    Tilepalette Window cannot found premade palettes. when i try to call the drop down menu, new creation window for palette pop up.
     
  19. BazookasZerreth

    BazookasZerreth

    Joined:
    Dec 8, 2016
    Posts:
    17
    Sometimes Unity Forgets the order of the children in a Prefab and won't reorder them after edits. (this doesn't happen often, but it seems like it "infects" the prefab: meaning any copied new prefab or variant will inhibit the same ordering issue )

     
  20. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,699
    That sounds bad. We'd appreciate a bug report with repro project and as much info about how to reproduce it you can.
     
unityunity