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 salex100m · Jan 05, 2014 at 04:08 PM · crashingfreezing

Unity (randomly) freezing on play

Hey everyone. I have an annoying bug I can't figure out. Unity freezes when I hit the play button (it doesn't ever turn blue). The only thing I've seen on the forums is talk about infinite loops. I'm quite sure my loops aren't infinite, but they aren't deterministic either.... let me explain:

Basically I'm randomly generating and placing a galaxy (starsystems-stars-planets-asteroids) inside a confined map. If a starsystem is within a certain range of another, then the placement will loop until it randomly finds a good spot. I don't think this is the issue as I have a breaker inside that breaks upon too many iterations.

So that is guess #1...

Guess # 2 is that the objects being placed have colliders (as triggers) and that unity can't handle placing colliders when they are placed on top of each other.

If I place 10 starsystems (roughly 6 planets each). It crashed 30% of the time. If it goes up to 20, it's like 100% crashes.

no errors, no debug statements. Also all the random generation is happening inside awake or start statements.

any thoughts?

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
Best Answer

Answer by salex100m · Jan 05, 2014 at 06:00 PM

I was able to solve this issue. I was using Random.Range(int, int) which makes the max int exclusive (Didn't know that). For example I was placing 10 objects into 9 slots and the while loop would freeze on the last one searching for an open slot.

But even with that issue, I don't understand why Unity didn't die elegantly? I had break loops that would break after 100 tries. Yet I never got the flag...

Is this a Unity bug? If you break an iterator on awake/start shouldn't Unity realize this and stop on start instead of just freezing/black screen.

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

18 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

Related Questions

Editor Fails to Re-Launch After Manually Killing The Task Due to Freezing 0 Answers

Unity crashes upon startup of any project 3 Answers

Unity crashes when I press play (Mac) 0 Answers

Why does it crash when i put 1st person controller in Heirarchy ? 0 Answers

When I create a script on mac, unity crashes! 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