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

Cinemachine 'DocumentationSortingAttribute' does not contain a constructor that takes 2 arguments

Discussion in 'Scripting' started by subzer0, Mar 26, 2020.

  1. subzer0

    subzer0

    Joined:
    Dec 10, 2010
    Posts:
    94
    Hello,

    I am using Unity 2019.3.6f1 and I am trying to work with the kart game from Unity sample templates and when I open the editor I get this error:
    Assets\Cinemachine\PostFX\CinemachinePostProcessing.cs(30,6): error CS1729: 'DocumentationSortingAttribute' does not contain a constructor that takes 2 arguments

    Here is the code:

    Code (CSharp):
    1. namespace Cinemachine.PostFX
    2. {
    3.      /// <summary>
    4.      /// This behaviour is a liaison between Cinemachine with the Post-Processing v2 module.  You must
    5.      /// have the Post-Processing V2 stack asset store package installed in order to use this behaviour.
    6.      ///
    7.      /// As a component on the Virtual Camera, it holds
    8.      /// a Post-Processing Profile asset that will be applied to the Unity camera whenever
    9.      /// the Virtual camera is live.  It also has the optional functionality of animating
    10.      /// the Focus Distance and DepthOfField properties of the Camera State, and
    11.      /// applying them to the current Post-Processing profile, provided that profile has a
    12.      /// DepthOfField effect that is enabled.
    13.      /// </summary>
    14.      //ERROR IS IN THIS LINE:
    15.      [DocumentationSorting(101, DocumentationSortingAttribute.Level.UserRef)]
    16.      [ExecuteInEditMode]
    17.      [AddComponentMenu("")] // Hide in menu
    18.      [SaveDuringPlay]
    I hope someone can help me fix this.

    Thanks.
     
  2. nadeemh1

    nadeemh1

    Joined:
    Mar 27, 2020
    Posts:
    1
    I have the same problem. Did you manage to fix it?
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Check if there is an update to the cinemachine package.
     
    PraetorBlue likes this.
  4. agmdstudiosllc

    agmdstudiosllc

    Joined:
    Jul 12, 2018
    Posts:
    9
    I have the same issue. Any responses??
     
  5. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    As @Kurt-Dekker said, you likely need to update Cinemachine.
     
  6. jhavelore

    jhavelore

    Joined:
    Mar 17, 2022
    Posts:
    1
    Necro time: I have updated cinemachine, and the error persists
     
  7. markaldo1

    markaldo1

    Joined:
    Feb 28, 2022
    Posts:
    2
    When you provided a constructor for your class that takes arguments, the compiler no longer creates an empty constructor. Therefore, you cannot call an empty constructor because it does not exist. You would need to explicitly write the constructor that takes 0 arguments in your class's code. The constructor of the inheritance class needs to construct the base class first. since the base class does not have a default constructor (taking 0 arguments) and you are not using the non-default constructor you have now, this won't work. so either:
    • Add a default constructor to your base class, in which case the code of the descending class needs no change;
    Or
    • Call the non-default constructor of the base class from the constructor of the descending class, in which case the base class needs no change.