not a question, just advice on public variables
public variables are great for when you are tweaking and easier, at times, then typing in GameObject.find etc etc. but the downside to not having them hard wired into the code is that you can loose them. I had a script whose name didn't match the class name so unity didn't load it, nor a few other scripts that referenced it. even after repairing the typo suddenly ALL - I mean EVERY SINGLE public variable was lost!. I mean dozens of scripts with as many as a dozen variables each. I spent two days reading every script trying to find out what I was suppose to drag into that slot. And while I was at it , I hard coded much of what I could
Hi. I just randomly come across this post and I just want to say, you can try using version control. It will solve this problem :)
Answer by shadowpuppet · Oct 27, 2017 at 01:17 AM
what is version control?
I can't explain it well so I'll just give you article I found. You can google for more.
Version control is an efficient, sometimes elegant way to keep track of your project's history.
It works like a time machine that you can use to fetch versions of files (code, images, whatever you're keeping track of) from the past.
It also let's you work on your project with a group of people a lot more efficiently than passing around individual files.
So basically if you are using version control, you are... 1. Using a software (there are a lot of options, Git, SVN, Hg...) 2. This software keeps track of your project's history (Every time after you modify your project, you "commit" the changes you made. This results in a revision. You'll have lots of revisions. You can resume your project to whatever revision, like a time machine.)
So I can imagine that once you find there's something wrong with your project, you just resume it. For example public variable values are serialized with scenes. If all your references are gone, you can try to revert your scene files.
Your answer
Follow this Question
Related Questions
Assets advice 0 Answers
public variable gameobject 0 Answers
Inputting another scripts variable as a float 1 Answer
What do you use MouseButtonDown and MouseButtonUp for? 0 Answers
Unity 4.1.5 is not showing certain public variables in the inspector 1 Answer