Accidentally moving folders within project window.

Hi Everyone,
I have accidentally moved folders many times within my unity projects and spent up to 15 minutes trying to undo what I did. I don’t like doing ctrl-z because that might undo other settings i applied to objects.
I have search the forums and the internets for potential solutions and nothing really preventive, all the answers seem to be reactive.

Is anyone else frustrated and do you consider this a common issue ?

I feel the easiest fix is to prompt a yes/no confirmation dialog when moving folders within the project window.

Anyone else think this might be a good feature to add ? Any comments welcomed.

Thanks,

P.S. [Edit] Obviously not everyone would want this feature, so a checkbox to enable or disable prompting in the editor preferences or wherever appropriate would be appropriate implementation.

2 Likes

It happens sometimes, but it’s trivial to instantly fix. See below.

As it is now the year 2021, please consider using proper industrial-grade source control in order to guard and protect your hard-earned work.

Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

As far as configuring Unity to play nice with git, keep this in mind:

https://discussions.unity.com/t/736093/3

Here’s how I use git in one of my games, Jetpack Kurt:

https://discussions.unity.com/t/807568/3

Using fine-grained source control as you work to refine your engineering:

https://discussions.unity.com/t/826718/2

Share/Sharing source code between projects:

https://discussions.unity.com/t/719810/2

Setting up the right .gitignore file:

https://discussions.unity.com/t/834885/5

Generally setting Unity up (includes above .gitignore concepts):

https://thoughtbot.com/blog/how-to-git-with-unity

It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place.

1 Like

This feature sounds irritating. If you do make this kind of mistake and can’t immediately repair the damage, that’s what your source control system is for.

Visual Studio has this feature, along with an option to turn the dialog prompt off if desired.
I can see this being a useful addition to Unity if it’s implemented in the same way.

But yes, as already mentioned, use source control regardless.

Thanks for the suggestions.

I already use SVN, and source control is reactive answer, as I would have to use the feature to compare or checkout, to get what was last saved in the repo.

What if I haven’t saved it yet to the repo and I purposefully made other changes to other files and folders but not checked them in yet as well. Maybe it was a newly installed package.
What if some people don’t use source control ?
What if source control system is down/unavailable or undergoing maintenance ?
What if someone is purposefully excluding a folder because it is apart of a custom package or plugin ?

For myself, I don’t move directories in Unity because it is easier to do with SVN anyway, so that 2-3 times a year I accidentally drag something is way more of a nuisance to me than being prompted.

This option maybe irritating to some people, but that is why I suggested a checkbox to enable (opt-in).

Just because the confirmation prompt may not suit your needs, doesn’t mean there are people out there who would use it. The point of the thread is to see if anyone else sees value in this.

Thanks everyone for reading. Happy Developing :slight_smile:

If Unity exposed the “move operation” with an interface much like IdragHandler then anyone could attach code as they see fit. Not attaching anything would be the same as it is today.

Potential reasons to attach code:
Logging of the operation
Command to send to Git/SVN such as commit move oepration.
Generate Assembly
Generate MipMaps/LightMaps/cached data.
Call another script.
Save project Settings/Assets
Confirmation Prompt

Unity may do things above auto-magically, but I included them because there could be edge cases.

For me obviously I would check if the target is a folder, then if so prompt something to the user, then cancel the operation if applicable. One could even code a default Y/n and an auto-accept Yes/no to the prompt if not answered within 30 seconds.

This exposure would only be available in the editor.

As far calling another script, it maybe that certain assets are hardcoded with Resources.Load method such as in a text config file or database and would need to be updated if moved.

I don’t use Unity’s ability to “associate” public objects within the inspector because it is cached in the library folder and I’d rather save it programmatically.

edit: just minor typos.