Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by FPSworrior · Dec 15, 2018 at 11:43 PM · errorscript.post processing

Need help with post processing error.

So I've updated unity to the newest version and updated the post processing stack and now I'm getting this error and I'm not sure how to fix it:


Assets_PostProcessing\Editor\PropertyDrawers\MinDrawer.cs(6,34): error CS0104: 'MinAttribute' is an ambiguous reference between 'UnityEngine.PostProcessing.MinAttribute' and 'UnityEngine.MinAttribute'


I'm not sure how to fix this though and I'm sure if anyone else has had this same problem, can anyone help me fix this? Here's the script I'm getting the error on:

 using UnityEngine;
 using UnityEngine.PostProcessing;
 
 namespace UnityEditor.PostProcessing
 {
     [CustomPropertyDrawer(typeof(MinAttribute))]
     sealed class MinDrawer : PropertyDrawer
     {
         public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
         {
             MinAttribute attribute = (MinAttribute)base.attribute;
 
             if (property.propertyType == SerializedPropertyType.Integer)
             {
                 int v = EditorGUI.IntField(position, label, property.intValue);
                 property.intValue = (int)Mathf.Max(v, attribute.min);
             }
             else if (property.propertyType == SerializedPropertyType.Float)
             {
                 float v = EditorGUI.FloatField(position, label, property.floatValue);
                 property.floatValue = Mathf.Max(v, attribute.min);
             }
             else
             {
                 EditorGUI.LabelField(position, label.text, "Use Min with float or int.");
             }
         }
     }
 }

And I think it's having some connection with this script:

 namespace UnityEngine.PostProcessing
 {
     public sealed class MinAttribute : PropertyAttribute
     {
         public readonly float min;
 
         public MinAttribute(float min)
         {
             this.min = min;
         }
     }
 }
 
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Honorsoft · Jan 15, 2020 at 02:57 AM

It's 2020 now, I have been trying out different versions of Unity and different projects lately, and I have been coming across the 'MinAttribute ambiguous' error a lot, and in searching for an answer online, I see a lot of others still are too. I have had sucess with a different fix than hexagonius mentioned. You make sure to have "`using Unity.Engine.PostProcessing` and add just put "UnityEngine." (including the period) in front of all the "MinAttribute" references. To clarify, instead of "MinAttribute", put "UnityEngine.MinAttribute".

So, here's a full script for anyone to copy and paste in case you don't want to do the typing:

 //MinAttribute.cs
 
 using UnityEngine;
 using UnityEngine.PostProcessing;
 
 namespace UnityEditor.PostProcessing
 {
 
     [CustomPropertyDrawer(typeof(UnityEngine.MinAttribute))]
     sealed class MinDrawer : PropertyDrawer
     {
         public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
         {
             UnityEngine.MinAttribute attribute = (UnityEngine.MinAttribute)base.attribute;
 
             if (property.propertyType == SerializedPropertyType.Integer)
             {
                 int v = EditorGUI.IntField(position, label, property.intValue);
                 property.intValue = (int)Mathf.Max(v, attribute.min);
             }
             else if (property.propertyType == SerializedPropertyType.Float)
             {
                 float v = EditorGUI.FloatField(position, label, property.floatValue);
                 property.floatValue = Mathf.Max(v, attribute.min);
             }
             else
             {
                 EditorGUI.LabelField(position, label.text, "Use Min with float or int.");
             }
         }
     }
 
 }
 
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SDC2X · Feb 25, 2021 at 08:35 PM 0
Share

for me work very goooooood .... ty

avatar image
1

Answer by hexagonius · Dec 20, 2018 at 08:27 PM

you need to fully qualify MinAttribute:

 [UnityEngine.PostProcessing.MinAttribute]
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FPSworrior · Dec 22, 2018 at 12:58 AM 0
Share

I'm not sure where I need to add or change code. I tried using this in different places but could not figure out how to use it.

avatar image purpl3grape · Jan 08, 2019 at 02:49 PM 0
Share

Confirmed replacing $$anonymous$$inAttribute with UnityEngine.PostProcessing.$$anonymous$$inAttribute resolved the error.

However, I'm not sure if this post processing will be discontinued in the future, as there seems to be a newer version that is obtained through the Package $$anonymous$$anager.

avatar image
0

Answer by YannLescot · Jun 04, 2020 at 08:58 AM

Just an update, you can't import Unity.Engine.PostProcessing (anymore?) Having UnityEngine Imported (`using UnityEngine;`) should be enough.

So, in your error message, a component is specified. In my case the error was :

 '*Vector2' est une référence ambiguë entre 'System.Numerics.Vector2' et 'UnityEngine.Vector2*' 

The specified object is "Vector2", so the only thing I did was replacing every Vector2 I had with UnityEngine.Vector2.

It fixed it ! :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by BlueDragoness · Oct 22, 2020 at 03:45 PM

In minattribute change "namespace UnityEngine" to "namespace UnityEditor".

I also added

using UnityEngine; using UnityEngine.PostProcessing;

to the top of this file before making that change. It didn't fix the problem on it's own, but if that first step doesn't work, perhaps it needed both. The first time I did it there was something random that happened about obsolete code and I had to change it back. I didn't understand what happened so I tried it again and it worked.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

138 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Interstitial ads is not showing 0 Answers

Unity freezes on play mode 0 Answers

All C# Shader Scripts giving CS 8025 Parsing Error. 2 Answers

How do I inherit certain varibles and functions from another script. 1 Answer

NetcodeForGameObjects compilation error 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges