Quantcast
Channel: Questions in topic: "skip"
Viewing all articles
Browse latest Browse all 85

Loading a www texture makes my game freeze for a second

$
0
0
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; }

Viewing all articles
Browse latest Browse all 85

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>