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 /
This question was closed May 31, 2015 at 10:26 AM by boxing_rex for the following reason:

No relevant answers provided

avatar image
0
Question by boxing_rex · May 29, 2015 at 03:26 PM · c#unity 5loadingworld

Unity - Long load time after pressing play button

Hi,

I have a scene for my 2D game that uses tiles to recreate the level, the problem is that it takes me around 48,000 tiles to make a map that is nowhere near is a big as I would like. Loading all of these tiles at runtime takes Unity about 30 seconds, which is like waiting a year when you are just making small adjustments to your code.

So my question is, how can I speed up the load times on massive 2D levels in unity? Should I perhaps split the world into chunks at runtime and only load the ones around the player, or is there another easier way.

Thanks for any help.

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

  • Sort: 
avatar image
0

Answer by KubaPrusak · May 29, 2015 at 04:26 PM

I assume you are generating these tiles at startup (void Start()). This uses a lot of CPU which is making you wait. If you are then there is no way to make the process faster. You would have to generate tiles in the Update() and generate the tiles when the player comes near to ungenerated regions.

Comment
Add comment · Show 4 · 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
avatar image boxing_rex · May 29, 2015 at 04:46 PM 0
Share

The tiles are not generated by a script, they are simply placed in the scene view using a custom tile placing script.

avatar image KubaPrusak · May 29, 2015 at 05:15 PM 0
Share

Oh so you already have a set of tiles in the scene view, and then their position gets changed by the script. If you are doing something a lot of times (ie 48000) it will considerably slow down the startup. I suggest that you only do this process when the player gets near the unplaced tiles.

avatar image boxing_rex · May 29, 2015 at 05:28 PM 0
Share

No script is attached to the tile GameObjects, Sorry if the last comment was unclear, but there is a script that only runs in the editor that allows me to click a place in the scene view and a tile gameObject will be instantiated at the point.

avatar image KubaPrusak · May 29, 2015 at 08:50 PM 0
Share

The only solution to such a problem is to load the tiles in chunks and only load chunks around the player.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Display spinning icon while some search method in progress ? 0 Answers

Issues with my loading screen 0 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

unity code with C# back to previous scene 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