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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

cinemachine error CS1513: } expected

Discussion in 'Scripting' started by sadicus, Aug 10, 2021.

  1. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    Unity 2020 - all i did was update to the new version of cinemachine.

    Library\PackageCache\com.unity.cinemachine@2.6.9\Editor\PostProcessing\CinemachineVolumeSettingsEditor.cs(240,2): error CS1513: } expected

    the unity forums are kinda toxic when people ask questions but really what exactly needs to be changed?
    Deleted the "}" looked for doubles, etc. nothing fixed the error.
     

    Attached Files:

  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,742
    If there's a compiler error in package code, you won't be able to fix it (Unity will literally revert code in PackageCache back to the version the package comes with), and it definitely needs to be reported as a bug.

    In the meantime:
    A) you can revert to a version of the package that compiles for you
    B) You might be able to find a workaround. It's extremely unlikely that Unity would post code that always causes a compiler error, which means in this case they have posted code that sometimes causes a compiler error; the only way that happens generally is because a poorly formed preprocessor directive must have been tripped that causes the compiler error. So take a look at that #endif directive, find the corresponding #if, and see what condition that directive depends on. Depending on what it is, you might be able to find the symbol in Project Settings -> Player -> Scripting Define Symbols and delete it, and see if that makes it compile; if you're lucky, it will be one you don't need elsewhere.
     
    sadicus likes this.
  3. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    can cinemachine just be deleted so at least the scene will run
     

    Attached Files:

  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,742
    Oh yeah, if you're not actually using cinemachine just delete it from the package manager.
     
  5. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    thank you for the explanation!
     
  6. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    this file: CinemachineVolumeSettingsEditor.cs
    is not in the project and Cinemachine wont delete!
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share a screenshot? It won't allow you to remove it in Package Manager? Make sure you don't have that file open in your editor when you remove the package. Also, the error is pointing to the Library cache folder. I would suggest that you first make a full project backup, then delete the /Library folder.
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    I'm sorry you've had this issue. Please consider using proper industrial-grade source control in order to guard and protect your hard-earned work.

    In the above case the fix is to revert one (very obvious) line of
    Packages/manifest.json
    to how it was before you attempted the upgrade and you would be instantly back to functional.

    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://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 the right .gitignore file:

    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.
     
  9. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    thanks for all the advice. Steps:
    1) Unity 2020
    2) create a new HDRP project
    3) open project manager and update the files that say update
    so don't trust Unity updates unless you back up the empty default project first. got it.
     
  10. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,742
    A good practice is don't trust anything unless you back up first. Use source control or you will be really sad sooner or later.

    Be advised, bug reports made in a Unity forum post don't get put into a system to be dealt with. Use the actual bug reporter app, which the devs pay attention to. It'll also include much more specific Unity version information and system info which will be important to debug this.
     
    Kurt-Dekker likes this.
  11. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    This should be the first thing taught in every developer class at every level. So much waste and destruction when people naively change something trivial yet crucial, and it completely borkles their whole project, or a drive crashes and wipes out years of hard work. So unnecessary.
     
  12. JumpingGuy

    JumpingGuy

    Joined:
    Jan 2, 2016
    Posts:
    69
    I had the same problem/error message today when I updated Cinemachine to 2.6.9 (stable).(Unity 2020.3.12f1)
    Updating to a newer version of Cinemachine (2.7.5) worked for me.
     
    HernandoNJ likes this.
  13. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    155
    This worked for me. (2020.3.15f2)
     
    HernandoNJ likes this.
  14. HernandoNJ

    HernandoNJ

    Joined:
    May 13, 2018
    Posts:
    75
    Upddating to 2.8.0 - 2020.3.15f2 working ok...
     
  15. VLRSOFT

    VLRSOFT

    Joined:
    Feb 29, 2020
    Posts:
    12
    How did you upgrade to the latest 2.7 or 2.8 version??? I have now downloaded the latest at the moment LTS 2020 3. 16f1 - it has the latest version of Cinemachine 2.6.9
     
  16. HernandoNJ

    HernandoNJ

    Joined:
    May 13, 2018
    Posts:
    75
    There must be an arrow in your Cinemachine pack. It shows you other versions
    upload_2021-8-18_14-11-11.png
     
  17. VLRSOFT

    VLRSOFT

    Joined:
    Feb 29, 2020
    Posts:
    12
    thank you very much!!!!!!
     
    HernandoNJ likes this.