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 Ranishe · Jul 22, 2013 at 04:06 PM · c#crashscriptingproblem

Unity Editor Crashes On Play Because of Import Script

I'm building an importer in C# that's meant to parse through the text of an FBX ASCII file, and build a model based on what it finds. However, whenever I try to execute the main function, the unity editor stops responding.

The main hangup I have is that the first statement of the function is a Debug.log() call, but that's never executed. I know that there are multiple infinite loops in the function, but these should all have breaks/returns (or at least have debug calls in case they hang up so I can look into them).

So, any thoughts on why a script would crash before executing the first statement? I hesitate to post the code because it's 600 lines, and no one part seems to have a special impact since I can't actually get anywhere in the execution anyway.

As a bit more context, the editor will run fine, even with references to the script (attached to an object, assigned as a variable in another script), just as long as I don't call it's main function.

For those interested here's a link to the code. Also to clarify, ImportAllFBX() is called from a different script.

Comment
Add comment · Show 2
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 dorpeleg · Jul 22, 2013 at 04:10 PM 0
Share

It seems you have many function, but you are not calling any of them?

avatar image Ranishe · Jul 22, 2013 at 04:11 PM 0
Share

Sorry I should have clarified. ImportAllFBX() is called from a different script.

1 Reply

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

Answer by vividhelix · Jul 22, 2013 at 04:21 PM

To narrow the problem down, add a return statement after the Debug.Log(). If that makes it stop hanging, you know the problem is in your script. You can work with moving the return statement around to pinpoint where your problem is (basically executing just parts of your code).

Comment
Add comment · Show 3 · 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 Ranishe · Jul 22, 2013 at 04:26 PM 0
Share

That's a really clever idea! I'll get on that thanks!

avatar image Ranishe · Jul 22, 2013 at 04:39 PM 0
Share

Okay, so I did what radlemur said (push return statements at various lines to find when the code breaks) which lead me to the problem. The top while(true) loop didn't have an escape. I forgot to break when I hit the end of the file.

avatar image vividhelix Ranishe · Jul 22, 2013 at 04:51 PM 0
Share

You might want to accept my answer then :)

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

17 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

Related Questions

help for life using guiTexture 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Crash the entire game 3 Answers

Distribute terrain in zones 3 Answers

IEnumerator coroutines crashing app when launched with datatyle "GameObject" passed in 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