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
2
Question by Acegikmo · Aug 26, 2012 at 08:57 AM · errordebugexitbreak

How do I stop/pause/break a build automatically on error?

I'm making a web player game, and I need some kind of way to break or pause when an error occurs.

Right now the game continues even if it hits an error, and that error breaks the collision code of an object, which breaks the gameplay entirely. The issue is that this error happens seemingly randomly, and I don't know the cause, so I can't break manually.

Is there a way I can make the game break/exit/pause/stop executing when an error occurs? And maybe even show the error as well, if possible.

Thanks!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by digiben · Feb 20, 2013 at 09:39 PM

Acegikmo, I just found that in MonoDevelop you can set which exceptions you want to break on automatically by using the Run->Exceptions menu. Then select the exceptions you want to break on. Most useful is the null error exception for me.

Comment
Add comment · Show 1 · 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 Acegikmo · Feb 21, 2013 at 08:48 AM 0
Share

But I guess the setting doesn't carry over to builds, that's only for debugging in the editor, right?

avatar image
0

Answer by JamesAMD · Jan 04, 2016 at 01:25 PM

I know this question is years old, but for Visual Studio users, this functionality has been implemented in version 2.0 Preview 2 (1.9.9) of Visual Studio Tools for Unity.

Just enable the "Exception support (experimental)" in Options->Tools for Unity->General, and use "Attach to Unity and Play".

Unity will automatically break when an exception is thrown and Visual Studio displays all sorts of debugging information.

Comment
Add comment · Show 1 · 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 Ziplock9000 · May 11, 2017 at 03:39 PM 2
Share

Unfortunately for many this very rarely works, even when everything has been set up the way it should be.

avatar image
0

Answer by lucbloom · Jul 01, 2021 at 09:49 AM

This answer has the complete guide. @Ziplock9000 is correct, it only works when you:

  • Enable the "Exception support" in Options => Tools for Unity

  • Turn on "Common Language Runtime Exceptions" in the DEBUG => Windows => Exception Settings dialog in Visual Studio.

  • Use "Attach to Unity and Play"

https://gamedev.stackexchange.com/questions/114891/how-do-i-make-unity-halt-on-exceptions

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

11 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

Related Questions

How to make keystore debugging ? 0 Answers

What to do when there is an error at runtime 1 Answer

Prevent editor-prev.log file from getting too big 1 Answer

Making an petrolling ai problem,Trying to make a petroling enemy ai problem 0 Answers

C# script failing silently? 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