Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How do i refer to an error?

Discussion in 'Audio & Video' started by justinequek1999, Jan 23, 2022.

  1. justinequek1999

    justinequek1999

    Joined:
    Oct 9, 2021
    Posts:
    3
    Hi, would like to know if its possible to write a script to refer to an error so that i can have a pop up message whenever a specific error comes out?

    Eg:
    Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Unsupported file or audio format. )
    Pop up: File was incompatible. Please try with another MP3 file.

    If yes, may i know how do i write it?
    something like
    if(request.result == UnityWebRequest.Result.SpecificError)
    {
    Debug.Log("Aaa u got that specific error..");
    }