Search Unity

Unity Error

Discussion in 'Editor & General Support' started by immoloco, Jan 12, 2016.

  1. immoloco

    immoloco

    Joined:
    Jan 11, 2016
    Posts:
    5
    When i created a new project this error appered and i cant avoidit

    Assets/Standard Assets/ParticleSystems/Scripts/WaterHoseParticles.cs(41,48): warning CS0618: `UnityEngine.ParticleCollisionEvent.collider' is obsolete: `collider property is deprecated. Use colliderComponent instead, which supports Collider and Collider2D components.'
     
  2. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    You'll want to make sure that along with the latest version of Unity you're using the latest version of the standard assets as those can break often if not kept up to date. I haven't run into this particular issue, but it seems like it's a warning and not an error, in which case you won't be stopped from playing your game or compiling your game code.

    If it is an error (logged in red in the console) then just go to the script and comment out the line number that the error is on.

    It will most likely look something like this:
    Code (CSharp):
    1. Collider col = gameObject.collider //We cant access colliders using this method anymore.
    2. //Comment out that line and instead use this
    3. Collider col = gameObject.GetComponent<Collider>();
    4. //That should remove the error and allow the script to work properly.
    I'm not sure how they declare the variable or what it's called, but you can just replace "Collider col" and "gameObject" with whatever variables they provide.

    If you are still having issues, double click on the error and paste the portion of code that is causing the issues.
     
  3. immoloco

    immoloco

    Joined:
    Jan 11, 2016
    Posts:
    5
    Do you think it might be an instalation error because when i was instaling it apered 3 instalation errors

    If it is an instalation error how can i solved it?

    PS:when i used your solution another error camed (more then 1 errors)