- Home /
Unity got Lag/Delay when change scene, How do I Fix it?
Hi guys, I have a lot of .png in my project, and I made it as an Animation sprites. I have 7 scenes and all of it have a animation sprites When I build it to windows version the project got delay when change scene on to another. I need solution! I had a .mov too to replace all of the sprites animation, but I don't know how to use it. Alhamdulillah. Regards. Ikhsan Syahputra.
How much time do you spend each time you change the scene?
This is quite normal. Here is what I do when switching scenes:
First create the LoadingScene scene, you can display anything here.
Fade the screen to black
Loading the Scene LoadingScene.
Fade the screen to LoadingScene
Load new scene, using LoadSceneAsync.
After you finish loading the new scene. Fade the screen to black
Unload LoadingScene.
Umm.. you're unloading old resources and loading new resources... Changing scenes takes time. I don't know what you're expecting here. $$anonymous$$ost of us just create loading screens to handle the loading time. If you simply want to change "areas" for the player, you could consider creating multiple "areas" in a single scene, and just setting the players transform.position
to wherever your other "areas" are.
Answer by Maritto7 · Mar 17, 2018 at 06:07 PM
Try experimenting loading scene while the player is reaching end of that scene and showing it when he finishes the level.
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html
I use this mostly in loading screens, but can be used other ways if you do not have resource issues like ram and cpu.
Answer by ikhsaniks · Mar 19, 2018 at 01:22 PM
Thanks for the answer @Maritto7 @haruna9x @RobAnthem . I have tried using my own method... but you guys are making my knowledge improve. My own method is when I wanted to build to the windows version, I'm changing the version to x86 and change the compression method to LZ4HC, it reduces the size of the app/.exe and it reduces the loading.
Your answer
Follow this Question
Related Questions
Can Unity play back Sprites on ipad enough to make Pixar quality “video” for a character? 1 Answer
How can I force unity to import the photoshop layers with the same size? 0 Answers
A few basic playables questions. 0 Answers
How to select an animation clip by index number? 7 Answers
How to stop animated texture looping in Unity Indie? 2 Answers