Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by WALID_GAMES · May 09, 2021 at 05:55 AM · unityeditorload scene

loading scene freeze problem

Hi there

so im new in unity and i am working on a 2d android game , so in this game i have 4 scenes the first one is a logo presentation that contain a raw images the second is the menu scene , the third is for the store and the fourth is for the game and its a long scene a little bit because the game is an endless runner so i duplecate levels to get a long running trip, so to go from scene 1 to scene 2 is okay also whene i click the store button leads me to the store scene normally and also whene comback from the store scene to menu works fine but to go from the menu to the game scene the editor freeze for about 1 minute than go to the game scene and it starts by a huge lag , so i test it in my android phone and its just like in the editor exept whene i click on the play button the game quits ,im using "SceneManager.LoadScene(index)" so any help i was searching around for an answer for while now without making any progress. Im using unity 2019.4.12.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ShadoX · May 09, 2021 at 06:03 AM

A wild guess is that you just have way too much content in Scene 4, which it why it "lags", since the game needs time to load everything. A few suggestions would be:


1) Look into Object Pooling. If the game's a "endless runner", then I'd have to assume that a lot of your visual content is just repeating several times and there is no need to have dozens of copies of the same GameObject in your scene if the Players can't see more than 1 or 2 maybe at a time (as an example).

The idea is rather simple. Instead of having 10~20 (or however many GameObjects you have right now), you just have a handful that you reuse. Instead of showing a GameObject once, you will just keep showing it again and again, as long as needed. Basically reusing it, rather than having multiple copies of it.

For example - can have a look at https://learn.unity.com/tutorial/introduction-to-object-pooling#5ff8d015edbc2a002063971c or try to search for tutorials for endless runners.


2) Not entirely sure if this will help or not, since I've not done any mobile dev myself, but another guess would be that you're just loading way too many GameObjects or basically an entire scene. The only thing I could think of would be to either only load the first few that the Players see at the beginning and try to load the rest as they play or alternatively look into creating a loading screen, so that your "lag" is replaced with some kind of loading bar, so that Players know that the game's still running and just loading things.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Undo has an interval within which it won't be registered 0 Answers

EditorGUILayout for GUIStyle 0 Answers

CreateAsset assets failing to load on Editor restart 1 Answer

Find Asset Path From Renderer Component 0 Answers

"using UnityEditor;" throws an error? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges