Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to optimize scene loading in Unity3D

I was wondering if there is any way to speed up level loading in unity3d. I currently have loading level between both scenes, but it yet takes around 5 sec to load new level on ipad3. That's quite a lot.

I've optimized all start and awake functions so there is realy little stuf going on there. However i have a lot of sprites in each scene and i think they took most of the loading time.

Could I somehow determine which objects needs to be load at start and which can load during first 10 secs of level? I tried adding level additive but that makes my game to lag for sec or two.

Any smart way of speeding it up?

like image 562
gabrjan Avatar asked Jun 04 '14 10:06

gabrjan


People also ask

Why does Unity take so long to open?

From my experience, a long loading time is first caused by not having enough memory available, and second, having the software and/or the project on the hard drive.


1 Answers

The time it takes to load your level is determined by the things that are referenced in your scene. The only way to cut loading time is to remove things.

You mentioned it would be fine to load some things after the level has started. You can do this using Resources.Load. However, this will only benefit you if there are no references to the thing you are loading. For example, if you have 100 trees in your scene it won't do you any good reducing that to 10. The tree is still referenced and will have to be loaded before your level can start. If you eliminate all of them then your level can start without loading the tree. It is then up to you to load it using Resources.Load and start planting them, maybe over the course of several frames to prevent a hickup.

like image 170
Tubeliar Avatar answered Oct 23 '22 04:10

Tubeliar