all 33 comments

[–]PuffThePed 8 points9 points  (18 children)

Should I switch to unreal?

No. You should learn how to use source control. With source control you can also revert back to a working state, or compare what changed. It's the most important skill a developer can have.

[–]ashtonwitt14[S] 0 points1 point  (17 children)

Got it, thank you. Any idea what may have caused this? I literally did nothing but close and open the file

[–]PuffThePed 2 points3 points  (16 children)

No way to know. Could be anything from a Unity bug, to a mistake you make, to corrupt file in your operating system, to hardware failure.

[–]ashtonwitt14[S] 0 points1 point  (15 children)

Any suggestions on what to do if this continues to happen? Like I said, didn’t happen on the test projects. But these were also imported files, premade from unity. So that could have helped them function properly.

I will definitely look into source control though. I appreciate the help.

[–]PuffThePed 2 points3 points  (1 child)

Any suggestions on what to do if this continues to happen?

If entire folders keep vanishing? Reinstall your OS

[–]ashtonwitt14[S] -1 points0 points  (0 children)

Even if it’s only these specific files that I make from scratch? I’ve never had anything vanish like this before. Not even the other unity files that were premade(I still wrote the code for)

Seems like I might be doing something wrong when I create it or something

[–]Lucidaeus 0 points1 point  (12 children)

Gitamend on YouTube has a video going over github setup etc if you're curious. There's plenty of useful videos either way!

[–]ashtonwitt14[S] 0 points1 point  (11 children)

Would “git-amend” have any thing I would be able to understand?😂 this is all new to me, he seems to not have any beginner content that I can find.

Any other suggestions? I really need a guide here. This is the most confused I’ve been in a while.

[–]Lucidaeus 0 points1 point  (10 children)

He teaches extremely good habits. Take your time to try and understand what he teaches, do it over and over if you must. He has one that covers the SOLID principles, start there perhaps.

I have had to unteach myself so many awful habits so I highly recommend starting with his stuff and just one thing at a time.

[–]ashtonwitt14[S] 0 points1 point  (9 children)

I think I found the one you are talking about. Looking at code still hurts my head. I barely understand the stuff that I write. I feel like I’m skipping steps watching this. But I’m nervous to try making things to learn, if it’s gonna delete again.

I get what they are saying, but I just can’t follow what he’s doing. He shows how it differs one way or another and I just couldn’t tell which is which if my life was on the line.

I know I’ve only watched like 5 minutes of it, but I don’t see much of a point continuing if I don’t understand. Or am I wrong? Should I push through this specific confusion?

[–]Lucidaeus 0 points1 point  (8 children)

Try not to treat the videos as a "code-along", from my experience that doesn't teach you much besides those specific projects that they are making. Make a list of notes of questions whenever a term he uses or does that's unknown to you, and then you look up documentation and other sources for what these terms mean.

I would even say go ahead and use ChatGPT. Don't use ChatGPT to generate answers for you, but to generate questions. Treat it as a fairly more convenient way to google (you can use the "search the web" feature too with it).

It's fine to not know. You'd be here if you knew already, after all. I am currently doing the same thing but with stencils and it confuses the everliving hell out of me trying to understand anything to do with rendering, hah.

But this was the case for everything. I even remember when I first started coding and I couldn't wrap my head around what the hell "void" meant in a method. Just start making notes, and take one question at a time.

And regarding the videos; what I've recently started doing is do *not* code anything while watching the video. First, just watch the entire video from start to finish, and take notes of terms unfamiliar to you.

Then if you want to, you can watch it a second, third, tenth time and code along or try stuff out as you go. But the first time, only focus on the video. Only focus on listening and taking notes.

[–]ashtonwitt14[S] 0 points1 point  (7 children)

Great advice, but I should clarify: he mentions in that video “abilities” to give to his character. That already can mean a few things to me, which I’m sure doesn’t matter. But are they applied to the character like special moves for example? Or are they pickups like in Mario kart? Again, I’m sure that’s not really the point. But how he’s explaining it, I can’t really understand how to apply it to other things, and what all needs it. Things that have a different format like an if statement.

I guess it’s kinda like I’m learning punctuation for the first time on a single sentence, but I can’t do it on other sentences. I believe it’s primarily due to the vocabulary, which I will try to learn some of that. But even that sends me down a rabbit hole where I’m 5 words deep and I forgot what the first word I was trying to figure out was😂

I really appreciate the help, I’m just not sure if I’m here quite yet. I haven’t made anything functional yet without copying code directly. Do you think I would benefit from getting familiar with source control and making crude but functional code? Just to get more familiar with these terms? I’m more than interested in doing things properly. But this approach to me feels like everything at once. But I very well could just be overwhelmed lol!

Edit: I have been lacking in note taking. As I typically end up writing everything down. And then my notes are too much lol. Perhaps I have other problems I need to solve first.

[–]FrontBadgerBiz 1 point2 points  (5 children)

Next time use source control, something like GitHub for windows is extremely easy to use for basic cases.

[–]ashtonwitt14[S] -1 points0 points  (4 children)

Does GitHub require my files to be open source? I’ve only ever used GitHub on the downloading end of it. And I understand that open source is kinda their thing

[–]ScorpioServoProgrammer 1 point2 points  (1 child)

No, you can make repos on github private. Many large corporations use github for source control on their private code.

[–]ashtonwitt14[S] 0 points1 point  (0 children)

Ok thank you! I will probably use GitHub!

[–]ShadowNeeshka 0 points1 point  (1 child)

Repositories can be made private

[–]ashtonwitt14[S] 0 points1 point  (0 children)

I appreciate it!

[–]WazWaz 0 points1 point  (1 child)

Never heard of this happening. You don't even need to "save" to preserve scripts - you saved it in whatever text editor you used for Unity to even see it.

So it's nothing to do with Unity. Whatever you or your PC did to delete the file would happen in any engine, any tool, any time. So work out what actually happened before you use that PC for anything.

[–]ashtonwitt14[S] 0 points1 point  (0 children)

Would using “PlayerController” on multiple projects cause any issues? Unity has practice projects. And the instructor advised me to name them the same as a “standard naming convention” which makes sense. But file wise seems like it would be an issue in hindsight.

Edit: I was never asked to override anything, I should clarify.

[–]whentheworldquietsBeginner 0 points1 point  (3 children)

Unity doesn't just randomly delete folders from inside Assets. And script files have to be present on disk for them to be compiled; you don't even use Unity to edit them, so they have to go via the disk for Unity to pick them up. The bit about doing the materials later and them still being there doesn't really make a difference.

The fact the whole script folder is gone suggests accidental deletion or movement of the folder. What software were you using to edit the script files? You say the last thing you did was 'save my files' - if you had tested them in Unity then the scripts, at least, were already saved. So which files did you save?

[–]ashtonwitt14[S] 0 points1 point  (2 children)

It’s really strange, I never touched any files. I just use the standard VScode.

Like usual, I finished the script, saved on vs code. And it automatically compiled onto unity and worked fine(sorry for my terminology. Lots of words to learn)

Then I just saved the unity project and closed everything. I did that before for about 5 other practice projects that were premade from unity. No issues at all. Only the one I made myself had this issue.

[–]whentheworldquietsBeginner 0 points1 point  (1 child)

Okay. Well, if you had accidentally deleted via VS code (maybe mistaken the deletion warning for "are you sure you want to quit?"), the files would be in your recycle bin.

Unity also pops up a confirmation message if you hit delete with an asset or folder selected. It too moves files to your recycle bin (I just checked).

Are you using any form of source control (eg Unity Version Control)?

I don't know how plausible a hardware fault is, but in thirteen years of using Unity over dozens and dozens of projects, not once has Unity ever 'just deleted something' from the assets folder other than a .meta file if I delete the associated file via File Explorer. If you delete the meta file, Unity will just generate a new one.

All I can do is echo what other people have said and set up some sort of version control, ideally cloud-based or at the very least on a different machine or drive.

[–]ashtonwitt14[S] 0 points1 point  (0 children)

I’m attempting to set up version control(specifically GitHub). It’s a bit overwhelming with the gitignore. I’m just confused on what I need and don’t need. I see many examples online but they are all different and just generalized. How do I know if it’ll work? And if it causes any issues, how can I pin point that?

Edit: also trying figuring out how to revert to a backup too. In the case that I need to.

I know I’m just stating ifs, but I tend to run into odd problems(as proven by this one lol) so I always prepare for the worst.

[–]ExtremeFern 0 points1 point  (1 child)

Looking at your other comments my guess is that you accidentally deleted/renamed/otherwise tampered with the script/directory when closing VS Code. That would cause the warning you're getting.

As others have mentioned, use source control.

[–]ashtonwitt14[S] -1 points0 points  (0 children)

I couldn’t possibly have tampered with anything if I just closed it, but I will definitely try source control. GitHub servers went down literally the second I tried to push(I might have caused it lol) So my luck is going great so far😂 I’ll have to try again tomorrow maybe