The situation is as follows: Unity3d. When the object is dynamically loaded from the prefab, if the object is complex, lags occur on mobile devices. At the same time, lags arise, even if we divide the loading of a new part of the map into separate objects.

Maybe someone knows how to deal with this?

PS: the most annoying thing is that the objects are absolutely not high polygonal, simply because of the lack of multithreading in the unit, the same load occurs in the main thread (

  • one
    then take out the loading of maps from the UI stream (the main stream of the android application). Xs sure how you got that. - DroidAlex
  • So the problem is that the flow is one in unity3d, however the answer is: answers.unity3d.com/questions/196413/… But all the same, suddenly there are some more convenient crutches than to make a pull of all used objects, and then reuse them. - Define

2 answers 2

Pool is not a crutch, but the only correct approach for solving such problems. Just for convenience, the creation of a pool might look something like this:

var instance = source.Spawn(); 

And unloading like this:

 instance.Recycle(); 

    If you have no problems with memory, you can do the loading of this heavy object at the start of the application, if necessary, turn on and off ( SetActive() ) GameObject.