Hello,
i’m trying really all but unity lags in any the following cases:
if i instantiate a prefab from resources
if i instantiate a prefab (not actived) and then when i active (gameobject.active = true) it lags.
if i instantiate a prefab with renderer.enabled = false. It lags with i set it to true.
The original prefab are prefabs saved from the editor with object in FBX format.
So it seems that doesn’t matter if the object is in memory or not. It’s not a lag of reading disk or set it in the memory, but it’s a render lag?
It’s really a pain if it is so cose it’s difficult to develop open words without lags… (and i’m talking of PC lag, trying it on an iphone it’s ridicolous).
i have experienced the same problem… when u instantiate something… a prefab with a few models… you get a long lag that lasts like 10 seconds. Something that isnt preloaded at the beginning.
Any suggestions on how to get around that? Besides loading it from the start in the background… because there are memory limitations.
I would be keen to know if anyone can shiny any light on this problem.
Is it Unity internals? and setting up the new object, scripts, shaders, etc?
Is it decompression? or uploading the new mesh/texture/shader to the gfx card?
I don’t want to instantiate every Prefab that I could possibly resource.load beforehand, so that it’s “cached” and I don’t get the stutter.
After many times i can say that probably the loading of new materials(and texture) let the engine lag on loading. If u use textures loaded at the start of the scene it freeze less…
but when loading a mesh on iphone in real time anyway freezes the iphone for a sec