Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Grysa · Sep 24, 2015 at 10:40 AM · unity 5crashingbugsrestart game

Unity Freezes after restarting level a few times

Hi, when my player dies a window appears to either play again or main menu, when i press play again it works fine and the level starts from start but after i play again 3 more times the unity editor freezes and i have to force quite unity, it always freezes on the 4th time that i play again. I am using Apllication.LoadLevel to restart the scene. Any ideas why this could be happening?

Comment
Add comment · Show 5
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 $$anonymous$$ · Sep 24, 2015 at 11:56 AM 0
Share

Copy your restart script here. Unity mostly freezes when it encounters an infinite loop, so I guess if it only happens at the 4th time, you either have an infinite loop which activates at the 4th try, or you parallely load the maps and after the 3rd load, unity can't handle the 4th one. But that's just blind guessing here.

avatar image Grysa · Sep 24, 2015 at 12:43 PM 0
Share

i tried commenting out the lines as you see still same problem.

  public Canvas deathScreen;
 
     // Use this for initialization
     void Start () 
     {
         //Event$$anonymous$$anager.PlayerDeath += new Event$$anonymous$$anager.GameEvent(PlayerDeath);
         //deathScreen.gameObject.SetActive(false);
     }
 
     void PlayerDeath()
     {
         if (deathScreen != null)
         {
             //deathScreen.gameObject.SetActive(true);
         }
     }
     
     // Update is called once per frame
     void Update () {
     
     }
 
     public void PlayAgain()
     {
         Application.LoadLevel(Application.loadedLevel);
     }
avatar image meat5000 ♦ Grysa · Sep 24, 2015 at 02:29 PM 0
Share

Try

 if(deathScreen)

ins$$anonymous$$d of != null

avatar image $$anonymous$$ Grysa · Sep 24, 2015 at 02:32 PM 0
Share

Have you tried $$anonymous$$imizing your game scene and paying attention to the gameObjects after your map restarts ? $$anonymous$$aybe a gameObject duplicates/triplicates/quadriplicates which could cause the problem

avatar image Grysa $$anonymous$$ · Sep 28, 2015 at 11:02 AM 0
Share

nope it does not duplicate at all.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Grysa · Sep 28, 2015 at 12:32 PM

Found the problem myself, basically in a script where i generate platforms i send each one to another script for a chance of a power up to appear on it, basically that was cousing the problem somehow so i just need to work around that.

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

32 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

Related Questions

Unity editor keeps on crashing 1 Answer

Massive problem updating to Unity 2019.1 0 Answers

THIS IS BUG of UNity 5.0.1 ???HOW I can SOLVE THIS? 1 Answer

Unity assets not importing from folder; scripts can't be created 1 Answer

How to fix WheelColliders in unity 5? 0 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