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

Path.Combine error?

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

Thread Status:
Not open for further replies.
  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")
     
  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:
    6
    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!
     
  6. vigneshj8133

    vigneshj8133

    Joined:
    Jul 1, 2020
    Posts:
    2
    Thanks a lot This is vey helpfull
     
  7. unity_finch

    unity_finch

    Joined:
    Aug 29, 2021
    Posts:
    1
    Thank you in Uzbekistan ❤
     
  8. Rich_crackeR

    Rich_crackeR

    Joined:
    Nov 20, 2019
    Posts:
    1
  9. nipunchathuranga45

    nipunchathuranga45

    Joined:
    Jul 3, 2021
    Posts:
    2
    Thank you its works now !
     
  10. unity_MH5Syl7ppdcscA

    unity_MH5Syl7ppdcscA

    Joined:
    Mar 18, 2020
    Posts:
    1
    Worked for me also!
     
  11. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,321
    Please don't necro posts. Simply use the like button to show appreciation. This thread is over 11 years old.
     
Thread Status:
Not open for further replies.