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
0
Question by NUKKschocke · Nov 29, 2018 at 02:07 PM · prefabtimeprofilermergeplay mode

Prefabs.MergePrefabs on entering PlayMode takes almost 4 minutes

Cross post from the unity forums where the issue is being ignored.

My project takes almost 4 minutes to go into PlayMode. Same goes for going out of PlayMode. What's weird about this is that this just started on my personal dev branch while it affected my colleague's and the development branch much sooner. So this seems to be tied to something happening with the actual scene.

Deep Profiling the process of entering PlayMode, I was able to get rid of a few logic loops that might've hindered my scripts. However, I DO need some tips on dealing with the elephant in the room.

The Prefab.MergePrefab call at start.

  • Image of the profiler window showing the Prefab.MergePrefab call

  • Forum post over at the Unity Forums

The weird thing is that the time allocated for the call in question is not the sum of its childrens' times. There is a LOT of functionality in this one call that is completely hidden from the user behind its name.

Does anybody know what is happening here and how to reduce it?

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

1 Reply

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

Answer by NUKKschocke · Dec 04, 2018 at 10:11 AM

Bump.


After some deliberation and trial-and-error, we have isolated the problem to definitely have something to do with the handling of prefabs in our scene. (This might seem like a no-brainer, but really having a definite focus for troubleshooting is a big step towards a solution)


There is an object in our hierarchy called "Forests". This is the hierarchy of its children:

Forests
| Phase0
  | forest-patch-0
    | treetype0 (prefab)
    | treetype0 (prefab)
    | ...
    | treetypeX (prefab)
  | forest-patch-1
    | ...
  | ...
  | forest-patch-n
| Phase 1
| ...
| Phase n

Because there is still not a good solution to merging large scenes, we decided to prefab the "Forests" object in its entirety in order to decouple it from the scene proper. This seems to be a grey area for Unity in regards to how it then tries to handle the "nested prefabs". In some way, the prefab instances of the individual trees get broken but in some ways, Unity still seems to recognize them on entering/exiting PlayMode and "do stuff" to them, encased in a call to Prefab.MergePrefabs, whatever that is.

Today, I broke the "Forests" prefab in the hierarchy and replaced all tree objects with their dedicated prefabs. Now play mode takes only about 10 seconds to start and exiting takes about the same time. This is a humongous improvement to the 340 seconds I started with.

Now. This still doesn't explain why my branch was still working fine even with "Forests" still being a prefab in my scene but I'm not gonna be complaining about results here. I'll keep an eye on this and update accordingly.

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

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

Entering Play mode is suddenly extremely slow 2 Answers

Wont instantiate game object 1 Answer

How to get prefab's creation time and date? 2 Answers

prefab time delay 1 Answer

Save Clone Geometry while in Play Mode (or export to Rhino) 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