Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Failed creating toolbar element

Discussion in 'Editor & General Support' started by mike11986, Sep 9, 2022.

  1. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    I've been getting a cryptic error that google is not helping me solve. When I hit play, this error sometimes occurs and sometimes doesn't. It still happens seemingly at random. I've tried pausing my cloud storage (Dropbox) and that doesn't seem to change the problem.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,966
    You are playing with fire. Directory sync services are NOT supported by Unity. You stand in peril of losing 100% of your work at any instant. You have been warned.

    Please consider using proper industrial-grade enterprise-qualified 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.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

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

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

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

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

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

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    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. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
  3. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    Thank you for your detailed help on how to protect my code! I'm not concerned of the possibility of losing 100% because I have it stored locally (including full copied backups) and on dropbox, but I have run across times when prefabs got broken. Regardless, I will look into that soon and get my work much better protected.

    Anyway, any idea on why I'm getting those cryptic error messages?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,966
    Nope.

    Keep in mind simply turning off Dropbox does not undo possible previous damage done to your asset database.

    I would try a reimport all perhaps.
     
  5. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    Well, the reimport didn't seem to fix it! Thank you for trying. Anybody else know why this might be happening?
     
  6. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    So I held onto the e-mail to come back and look at this, and frankly, I'm VERY confused after reading through a couple of these links. I dug up very basic source control information, and some people said it doesn't back up everything. I also determined that source control's main function is when working with a team of people all working on the source code and helps with versions and what not. I can see how this could get messy and need some sort of team management feature, but long story short, I'm left wondering whether source control helps a one person amateur and what to do for backup if dropbox is the wrong result. Any ideas? Thank you!
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,966
    It does. It's just a "savegame cart" for programming. That's all it is.

    Watch this:

     
  8. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    Ok, I'm getting the idea of what it does and can see a few advantages, so coupling that video with what you posted above, I have a few questions.

    1. How do you know which files to put in the git for unity?
    2. Where and how is a git stored on your computer?
    3. Do gits get extremely large?
    4. Is there some sort of GUI for git? I'm not much of a fan of terminal, though I recognize that video was using Linux. I'm on Windows, so I'm guessing this would be command prompt.
    5. How were you able to view file changes like you screenshotted in your 2nd link in your post above?
     
  9. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    6. It seems like this needs to be integrated into something. Like say there's people changing .cs files in a visual studio project, then they need to be compiled. Does one just sync up to, say github, download the current versions of file changes, and then open the visual studio project and compile it?
    7. In the case of unity, you have to close, update the git, and reopen. You say you do that very often, but it takes a pretty good bit of time to load a unity project. Does this not slow you down considerably to have to close and reopen for every new git version?
    8. Overall, I'm seeing this as a means of creating backups each time that is smart enough to probably keep the file size down by tracking changes rather than making lots of copies. In addition, it can track version history more nicely. However, those seem to be the fundamental differences between this and standard copying a directory. It is clearly better if it works the way I think it does, but have I missed something fundamental about these?
     
  10. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    The .gitignore file handles this.

    There is no 'a git'. You use git to manage repositories, or 'repos' for short. They are stored wherever you make them, which is usually the same folder as your Unity project.

    There's tons. GitHub is a straight forward one.

    It doesn't have to be integrated into Unity. It be done completely separately (such as Github).

    You 100% don't have to close Unity to make commits.

    It's version control on steroids that gives you 100% granular control over your changes, such as rewinding changes down to the individual line of code.

    It's industry standard to use version control software when making applications. There is zero argument to not using it.

    Just use Github.
     
  11. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,966
    Agreed. But you must save scene and Save Project, otherwise Unity-managed assets won't necessarily be ready to be committed.
     
  12. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    Ok, thank you for all of the information! Let me follow up with questions matching mine above:

    1. So the .gitignore helps determine what to not save. How do you determine what you do save? I know certain folders are not really needed for backup, as unity will create them, such as the library folder.

    2-3. Fair, so git manages repositories. How is a repository stored on your computer? Is it just one massive file with a particular extension?

    4. It appears that github helps you manage the looking at files, but all I've seen so far for doing the commands is with command prompt or terminal. Is there a GUI to determine which files are committed, do a quick commit, etc.?

    5. How were you (Kurt-Dekker) able to view file changes like you screenshotted in your 2nd link in your post above?

    6. What process would you use to get access to the newest files and use them if somebody else had recently modified them?

    7. I suppose that means there are a number of locked files to avoid so this works without closing unity. I'll probably figure that out reading through the .gitignore stuff.

    8. I can definitely see the advantages of revision history. My current tactic is to comment out a copy of the code if I drastically change it. The only argument I would have of not using it is it seems like a very steep learning curve to climb! But I'm trying. My method of learning is doing some reading and/or video watching and then asking questions to clarify.
     
  13. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    We can blab on all day but just stop asking questions and start using it.
     
  14. rangleme

    rangleme

    Joined:
    Jul 12, 2016
    Posts:
    2
    My 2-cents... YMMV
    None of these answers address the toolbar error - still wish I knew why Unity throws that one.

    GIT doesn't understand Unity, and Unity can't really tolerate GIT.
    As with any version control, it must be configured properly - in this case a good .gitignore.
    Also, NEVER use your file system or GIT for any copy, move, or rename operations.
    Only use Unity (Project view, Hierarchy view, or Inspector) for any copy, move, or rename operations.
    The reason is because Unity hashes every file and location in the metafiles, if you do a file operation outside of Unity you are corrupting your project meta files.
    Every Unity file operation will break your GIT history - live with it.
    There is no safe way to branch & merge in GIT without the potential of ruining you Unity project - don't use branch & merge. One project (MAIN) and don't do any file operations outside of Unity.

    I've been using Unity for 13-years, I've designed and developed video games for over 4-decades.
    I've used GIT a lot with Unity - I don't like it.
    I personally recommend SVN - it has all the same problems, but isn't nearly as complicated.
    I believe that PlasticSCM is the only VCS that works well with Unity... but I haven't tried it yet, maybe next project.
     
  15. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,966
    I dunno about that man... sounds like you're using it wrong. We use git at scale with about 100 engineers and artists all working in Unity committing to git, many different projects, extensive source code sharing with version-controlled submodules, and a CI/CD system that hoovers it all down and builds it on demand.

    And we use git flow and sometimes have very long-lived feature branches, although when we do we plan for it and create new work areas to accommodate temporally-distant work.

    Works like a charm every day.

    Not true at all. That's on your git client for one, but if you want give it the best shot at history tracking with
    --follow
    , then commit ALL your work, move all your files in Unity, which will move the metas, then commit them at their new location. The fact that they were only moved will be picked up quite well.

    You just blew your credibility out of the water with that statement. A lot of people "believe" a lot of really strange things in this world, and none of that belief is called "engineering."

    Good luck man. :)