Search Unity

I'd like to "Create a Space Shoot 'Em Up With Unity" but this is standing in my way...

Discussion in 'Editor & General Support' started by Brian-Washechek, Jun 27, 2019.

  1. Brian-Washechek

    Brian-Washechek

    Joined:
    Aug 5, 2015
    Posts:
    846
    upload_2019-6-26_18-38-15.png
    /\ It didn't used to look like this, but I got into the assets directory and deleted the entire directory. (I think I worded what did right.) Anyway if would like to set that back up.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's best not to delete things you need.
     
  3. Brian-Washechek

    Brian-Washechek

    Joined:
    Aug 5, 2015
    Posts:
    846
    So... Is a there anyway I can get it back? Even if it means starting from the beginning again?
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Deleting an asset should have caused those files to move to the Recycle Bin. Check your recycle bin. Sort on Date Deleted, and you should find all the stuff you deleted. You can right-click and restore any files.

    upload_2019-6-27_13-5-50.png

    I'm not sure how successful that will be, and you should probably just start over from scratch. I'm not sure what kind of stuff might have been deleted that isn't represented as a file (if any).
     
  5. Brian-Washechek

    Brian-Washechek

    Joined:
    Aug 5, 2015
    Posts:
    846
    No luck...

    upload_2019-6-28_16-27-40.png

    Luckily it was (basically) just an empty project. Unlikely I have no idea how to code it again. upload_2019-6-28_16-49-23.png
    I'm willing to just start from the beginning again. I am in need of direction to just fix the error above.
     

    Attached Files:

  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Start over means to start from scratch on a new project. Abandon this one, as you may have broken it beyond repair, and it's probably not worth the headache to get everything working again. Also, it looks like this is just a tutorial project you downloaded anyway? So, just go download it again, and start over.

    If that's not feasible, then look at the error. It's complaining about the class "Where you're at.cs", probably among many other things. Open that file. Does it look like this?

    Code (CSharp):
    1. public class Whereyou'reat : MonoBehaviour
    2. {
    3.    // Start is called before the first frame update
    4.    void Start()
    5.    {
    6.          
    7.    }
    8.  
    9.    // Update is called once per frame
    10.    void Update()
    11.    {
    12.          
    13.    }
    14. }
    Hopefully you can see that's all messed up, with the single-quote being used in the file name.

    The lesson is: don't put weird characters in file names. Unless you know what you're doing, keep file/class names alphanumeric. Underscores if you really want.

    Unity doesn't seem to watch your back in this case, and allows you to choose a script name that will ultimately cause a compilation error. Anyway, check out that script, see if it has a single quote in it, and choose an acceptable name. Otherwise, show your code for that file so we can see what's wrong with it.
     
  7. Brian-Washechek

    Brian-Washechek

    Joined:
    Aug 5, 2015
    Posts:
    846
    ...

    upload_2019-6-30_10-49-46.png

    I'm thinking something is seriously wrong with my computer. I'm thinking at this point everything would just work if I just try a format. The sole function of this machine is Unity programming anyway. What do you think?
     
    Last edited: Jun 30, 2019
  8. Brian-Washechek

    Brian-Washechek

    Joined:
    Aug 5, 2015
    Posts:
    846
    Here is a link to what I'm working on.
     
  9. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    There's almost certainly no need to format.

    See my last post, where I already explained what your issue is. The compiler errors you're showing are exactly what you get if you have a single-quote in your class name:

    upload_2019-6-30_17-56-8.png

    Again, don't use special characters as class names. Fix this by removing the single quote from the class name. After that, make sure that the class name is the same as the file name. So, make you sure also change "Where You're At.cs" to WhereYoureAt.cs, no spaces, so it exactly matches the class name. Make sure the use of upper and lower case letters is also consistent between the class name and the file name.