What does "Assertion failed on expression: 'prefab.IsPrefabParent()'" mean on my source data?

I’m sporadically getting the error message:

Assertion failed: Assertion failed on expression: 'prefab.IsPrefabParent()'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

In my error log.

It hints that something might be wrong with some of my prefab data, but it doesn’t indicate which files nor gives me information about what parameters trigger this assertion.

This function does not seem to be accessible from the public API so i have no documentation to fall back on.

Does anyone know what that function is evaluating so i can try and find the source data?

I’ve got the same issue after I tried to import some prefab files created by Unity 2018.2beta back into Unity 2018.1.2f1

It seems the serialization format has been changed since 2018.2, the ‘serializedVersion’ value is upgraded from 5 to 6 by 2018.2.

The ‘m_IsPrefabParent’ been renamed to ‘m_IsPrefabAsset’, and I guess this assersion is caused by missing value.


My solution is not very simple, which you could use as reference:

1st , force generate text format prefab in 2018.2 by changing Edit > Project Settings > Editor > SerializationMode to ‘ForceText’

2nd, copy them to the 2018.1 project folder and downgrade content by replace 4 text strings:

  • “serializedVersion: 6” => “serializedVersion: 5”
  • “m_CorrespondingSourceObject” => “m_PrefabParentObject”
  • “m_IsPrefabAsset” => “m_IsPrefabParent”
  • “m_SourcePrefab” => “m_ParentPrefab”

If you are still having the error after having modifying each scenes/prefabs and it is occurring on 2018.2.x and 2018.1.x, it means you have broken prefabs links. Here is the not so great solution:

  1. Go to your editor logs (see doc )
  2. Search for Assertion failed on expression: 'prefab.IsPrefabAsset()' lines and look for Opening scene 'Assets/Scenes/MainHololens.unity' who must be on top of it, that way you know at least which scene have broken prefabs links
  3. On your scene, click on the select button in the prefab instance’s inspector
  4. If it display missing prefab, you will have to recreate you prefab

By the way this error is not so harmless, you could lose a lot of work if you delete the scene containing the only instance of your prefab !!

Mac version of script from CelitoOokaIsland and gwendalbroudinpro:
find . -type f -name '*.prefab' -exec sed -i '' -e "s/serializedVersion: 6/serializedVersion: 5/g; s/m_CorrespondingSourceObject/m_CorrespondingSourceObject/g; s/m_IsPrefabAsset/m_IsPrefabParent/g; s/m_SourcePrefab/m_ParentPrefab/g" {} \;

Really thank you !!! You save my work !

PS : that’s work also for Unity 2018.2+ to Unity 2017.1+