Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
3
Question by max_autious · Jun 20, 2018 at 12:59 PM · programmingprefabsdata

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?

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

4 Replies

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

Answer by FantasyDR · Jul 19, 2018 at 12:23 PM

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"

Comment
Add comment · Show 4 · 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 DRRosen3 · Aug 05, 2018 at 11:20 PM 0
Share

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"

@FantasyDR Please explain this in better detail. In what file do we change those lines?

avatar image FantasyDR DRRosen3 · Aug 08, 2018 at 11:39 AM 0
Share

If you changed the Serialization$$anonymous$$ode to ForceText, all the prefab files are text based. You could open them by using any text editor (becareful do not modify the content by accident)

Replace those strings in your text based prefab files created by 2018.2.

You should do this in Unity 2018.2 env and do not forget to turn-off the 'ForceText' option and revert all changes.

I do not suggest any user to manually do this if you're not familar with Unity serialization or prefab data.

avatar image CelitoOokaIsland · Aug 28, 2018 at 05:27 PM 1
Share

If you are using Windows and you don't want to do it manually and want this change to be applied to all of your prefab items, you can use this PowerShell command line, running it from your assets folder:

    Get-ChildItem ./ *.prefab -recurse |
        Foreach-Object {
            $c = ($_ | Get-Content) 
            $c = $c -replace 'serializedVersion: 6','serializedVersion: 5'
            $c = $c -replace 'm_CorrespondingSourceObject','m_PrefabParentObject'
            $c = $c -replace 'm_IsPrefabAsset','m_IsPrefabParent'
            $c = $c -replace 'm_SourcePrefab','m_ParentPrefab'
            [IO.File]::WriteAllText($_.FullName, ($c -join "`r`n"))
        }
I$$anonymous$$PORTANT NOTE: if you are using git with your project, be sure to NOT run this on the folder where your '.git' folder is since it could corrupt your git history;

avatar image gwendalbroudinpro CelitoOokaIsland · Oct 05, 2018 at 08:32 AM 0
Share

Don't forget to add an empty line at the end or each time your will open/use it, Unity will add it and mess your git history

     Get-ChildItem ./ *.prefab -recurse |
             Foreach-Object {
                 $c = ($_ | Get-Content) 
                 $c = $c -replace 'serializedVersion: 6','serializedVersion: 5'
                 $c = $c -replace 'm_CorrespondingSourceObject','m_PrefabParentObject'
                 $c = $c -replace 'm_IsPrefabAsset','m_IsPrefabParent'
                 $c = $c -replace 'm_SourcePrefab','m_ParentPrefab'
                 [IO.File]::WriteAllText($_.FullName, ($c -join "`r`n") + "`r`n")
             }

avatar image
0

Answer by gwendalbroudinpro · Oct 05, 2018 at 08:46 AM

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 !!

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 TangledRealityStudios · Nov 23, 2018 at 06:17 AM

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" {} \;

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 Gui205 · Dec 12, 2018 at 03:12 AM

Really thank you !!!! You save my work !

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

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

159 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 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 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 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 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 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

How to Make 1 Script Give Different Values To Multiply GameObjects? 0 Answers

How do I make a centipede/conga line out of game objects? 0 Answers

Prefab Camera - Variables Not Updating 1 Answer

Spawn different player prefab unet 0 Answers

To Low FPS. What can I doo. 2 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