Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Path.Combine error?

Discussion in 'Scripting' started by blue2fox, Mar 9, 2012.

  1. blue2fox

    blue2fox

    Joined:
    Jun 8, 2008
    Posts:
    91
    I'm having an issue with Path.Combine, within my project. I'm pretty sure Path.Combine is used properly, because I've checked it out in the scripting reference, and the script is actually imported from Prime31's package. The error I get is that Unity tells me:

    "'Path' does not contain a definition for 'Combine'"

    The script is:
    Code (csharp):
    1. string basePath = Path.Combine( Application.dataPath, "Editor" );
    Anyone else getting this error? I know that Unity 3.5 now has a new definition for Path, with their PathFinding system, and I'm assuming this could be causing the issue, but I'm not too sure...
     
  2. blue2fox

    blue2fox

    Joined:
    Jun 8, 2008
    Posts:
    91
    Fixed the problem by adding System.IO, in front of Path, to become:

    System.IO.Path.Combine(Application.dataPath, "Editior")
     
    parvez_alam and tobiasfr like this.
  3. danishsshaikh

    danishsshaikh

    Joined:
    Mar 15, 2019
    Posts:
    5
    Thank you ♥
     
  4. xZare

    xZare

    Joined:
    Dec 15, 2019
    Posts:
    3
    Thank you. I've been searching the solution for 2 hours. Well done !!!
     
  5. Marioooo

    Marioooo

    Joined:
    Sep 20, 2017
    Posts:
    5
    for those who are having this issue, i've encountered myself and found out that another script that i created had a Path class and that's what caused the conflict. I renamed the class and all errors where gone... hope this helps!
     
unityunity