Search Unity

Help with Error CS0619

Discussion in 'Scripting' started by Deleted User, May 29, 2015.

  1. Deleted User

    Deleted User

    Guest

    Hi, i was downloading a Asset from the Asset Store and it gives me an Error CS0619 and i try to fix it.

    Im using Unity 5.0.1f1 and i just start with programming and it frustrates me to find no answer, so i hope for some little help from People who got experiences with this error.

    Code (Csharp):
    1.  
    2. {
    3.      UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(
    4.                 gameObject,
    5.                "Assets/Crafty/Examples/Test Scene1/Scripts/ErrorHandler1.cs (41,4)",
    6.                 "ErrorBehaviour" );
    7.       gameObject.GetComponent<Launchie.ErrorBehaviour>().ex = ex;
    8.   }
    9.  

    Error:
    Assets/Examples/Test Scene1/Scripts/ErrorHandler1.cs(41,71): error CS0619: `UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(UnityEngine.GameObject, string, string)' is obsolete: `Method is not meant to be used at runtime. Please, replace this call with GameObject.AddComponent<T>()/GameObject.AddComponent(Type).'
     
  2. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    Do as the error says. Replace "UnityEnhineInternal.APIUpdateRuntimeServices.AddComponent() with GameObject.AddComponent()
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    thank you, i just delete the asset and downloaded a for me Personally better asset
    i will remember the post and your answer!