Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Detect if null references or Errors

Discussion in 'Scripting' started by nBublot, Jan 11, 2021.

  1. nBublot

    nBublot

    Joined:
    Mar 11, 2020
    Posts:
    2
    Hi! For the sake of our project and debugs, we want to detect when an error occures in the code. Is there a way to detect with like a listener or something like this ? I know there's the "try catch". But I can't go in each script to modify each methods to implement a try catch.
     
  2. Ray_Sovranti

    Ray_Sovranti

    Joined:
    Oct 28, 2020
    Posts:
    172
    nBublot likes this.
  3. nBublot

    nBublot

    Joined:
    Mar 11, 2020
    Posts:
    2
  4. NOT_A_ROBOT1101

    NOT_A_ROBOT1101

    Joined:
    Jun 18, 2020
    Posts:
    39
    All errors (exceptions), unless inside a try/try-catch block, will always be put in the Unity console.
     
    nBublot likes this.