- Home /
Loading a www texture makes my game freeze for a second
I'm trying to load a texture via WWW dynamically. I am setting the url variable and then calling the following Coroutine. The code works, but when the texture is set to the www result then the game freezes for about a second (I'm assuming while the texture is applied). Is there a way I can prevent this from happening.. perhaps by loading the texture into memory first or something?
Of note: the texture is 4096 x 2048 and is about 715k in size. I've tried doing the same with a texture 1/4 the size and it still freezes, just for a shorter period of time.
IEnumerator LoadMapLarge() {
WWW www = new WWW(url);
yield return www;
renderer.material.mainTexture = www.texture;
}
I have the same problem, I'm very interested in a solution for this
Answer by flarespeed · Mar 04, 2014 at 06:56 PM
I would try loading the texture onto an object that is hidden behind something at the start of the game. This would theoretically freeze the game when you start it, sort of like a loading time.
Your answer
Follow this Question
Related Questions
loading from disk, saving to database 0 Answers
Exception: not implemented? 2 Answers
Screenshot PNG to GUITexture (NONE Texture) 0 Answers
Host Image/Texture using Unity server, then request it using WWW on client 0 Answers
www.texture textureType to GUI 0 Answers