OdinAttributeDrawer: no suitable method found to override

Issue #754 resolved
Vincent Noel created an issue

Unity version: Unity 2021.1.0b6.1892
What happen: A compilation error occurs when copy pasting the example from the documentation.

How to reproduce it:

Same error on Odin 3.0.1

Comments (3)

  1. Antonio Rafael Antunes Miranda

    The error message does indicate that the DrawPropertyLayout method inside your CustomRangeAttributeDrawer is not like the example you’ve linked. Please review your code and make sure that your CustomRangeAttributeDrawer looks like this:

        protected override void DrawPropertyLayout(GUIContent label)
        {
            this.ValueEntry.SmartValue = EditorGUILayout.Slider(
                label, this.ValueEntry.SmartValue, this.Attribute.Min, this.Attribute.Max);
        }
    

    In particular look at the parameters of the DrawPropertyLayout function and make sure they’re the same.
    Let me know if that resolved your issue. 🙂

  2. Tor Esa Vestergaard

    The documentation has been updated for a while now to reflect the correct method to override, I believe.

  3. Log in to comment