• 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 /
  • Help Room /
avatar image
Question by NerdIt- · Nov 26, 2019 at 10:16 AM · loadingcrashingerror build

Game build crashes when loading new scene but not in the Editor

Hi, I have a problem where I have built a unity project with a menu and a game scene. In the game scene, I have an object with a script on it that procedurally generates terrain. In the built version of the game, if I load the game scene and then move back to the menu, once I enter the game scene again, during the load, the game will freeze and then crash. I traced the problem back to the terrain object. I thought it might be the DontDestroyOnLoad object that was causing this but all that it did was generate a Debug script of some kind.

I built the game into a Development version of it and the last paragraph of the Player.log before unity crash, says:

 (Filename: C:/Users/isaac/Desktop/NerdIt/Geometria/Geometria/Geometria 2.0/GeometriaHDRP/Assets/Script/LoadingMech.cs Line: 20)
 
 UnloadTime: 0.497700 ms
 OutOfMemoryException: Out of memory
   at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_array_new_specific(intptr,int)
   at System.Collections.Generic.List`1[T].set_Capacity (System.Int32 value) [0x00021] in <c79628fadf574d3a8feae0871fad28ef>:0 
   at System.Collections.Generic.List`1[T].EnsureCapacity (System.Int32 min) [0x00036] in <c79628fadf574d3a8feae0871fad28ef>:0 
   at System.Collections.Generic.List`1[T].Add (T item) [0x00010] in <c79628fadf574d3a8feae0871fad28ef>:0 
   at MarchingCubes.March (System.Single x, System.Single y, System.Single z, System.Single[] cube, System.Collections.Generic.IList`1[T] vertList, System.Collections.Generic.IList`1[T] indexList) [0x001b0] in C:\Users\isaac\Desktop\NerdIt\Geometria\Geometria\Geometria 2.0\GeometriaHDRP\Assets\MeshTech\MarchingCubes.cs:61 
   at Marching.Generate (System.Collections.Generic.IList`1[T] voxels, System.Int32 width, System.Int32 height, System.Int32 depth, System.Collections.Generic.IList`1[T] verts, System.Collections.Generic.IList`1[T] indices) [0x000c5] in C:\Users\isaac\Desktop\NerdIt\Geometria\Geometria\Geometria 2.0\GeometriaHDRP\Assets\MeshTech\Marching.cs:62 
   at Grids.DrawMesh () [0x0006f] in C:\Users\isaac\Desktop\NerdIt\Geometria\Geometria\Geometria 2.0\GeometriaHDRP\Assets\Script\Grids.cs:112 
   at Grids.Start () [0x0006d] in C:\Users\isaac\Desktop\NerdIt\Geometria\Geometria\Geometria 2.0\GeometriaHDRP\Assets\Script\Grids.cs:36 
  
 (Filename: <c79628fadf574d3a8feae0871fad28ef> Line: 0)
 
 System memory in use before: 504.9 MB.
 System memory in use after: 432.9 MB.
 
 Unloading 30 unused Assets to reduce memory usage. Loaded Objects now: 2402.
 Total: 486.089200 ms (FindLiveObjects: 0.196200 ms CreateObjectMapping: 0.049000 ms MarkObjects: 479.696500 ms  DeleteObjects: 6.147100 ms)



I have no idea what any of that means. I assume it is something to do with one of my mesh generation scripts, but I don't know which one. So I am going to post the link to the project download.

I really need help with this. If I can't figure this out I am going to have to force the player to restart the game every time they want to re-start up the scene. I am desperate.

Project Assets: https://drive.google.com/file/d/1_46uJYcW5arDRO-3TZBQob69Vt7JxaHd/view?usp=sharing

Comment

People who like this

0 Show 0
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

0 Replies

  • Sort: 

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

188 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 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

Build Crashes on Startup 1 Answer

My project doesn't open as Unity stops responding 1 Answer

Loading game data crashes on android 0 Answers

How to generate loading bar for UNET 1 Answer

Pickup number of objects and have another object appear? 2 Answers


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