Search Issue Tracker

Fixed in 4.5



Found in


Issue ID




Combining namespaces MBs with default params break



1) What happened
Combining namespaces MBs with default params break

Having a default parameter value specified for a method in a mono behaviour in a namespace will result in great weirdness - including the behaviour no longer being addable to GameObjects.

2) How can we reproduce it using the example you attached.
In ImpactCamera.cs and TouchGestures.cs you'll find some TODOs around workarounds for this problem. Flip the commenting on the code involved and try adding either component to a GO.

Comments (11)

  1. 197563b47fc8878cfb589db186ab3aba?d=mm


    Apr 30, 2017 06:20

    Still experiencing this on Unity 5.51f1 :(

  2. 65cbbeda3d599ff54535f1b82e07411b?d=mm


    Oct 31, 2015 02:30

    Currently having the issue in 5.1.3f1 on Windows 8.1

  3. 299f0793a1129357fda2ae0b6270868a?d=mm


    Sep 29, 2014 02:32

    The issue is still present on Mac OS X.

  4. 0ba3bfdf227906a15ba26b66b8cc7d6f?d=mm


    Jul 08, 2014 21:48

    This issue appears to have been fixed in Unity 4.5 on Windows, however it is still easily reproducible on OS X.

  5. Daf3bb256ed3cd67242abaf657438810?d=mm


    Apr 10, 2014 13:23

    Still present in 4.3.4.

  6. 281c2df7dbce9284dca6059db944f8df?d=mm


    Feb 23, 2014 11:41

    Yep this is still happening. Super easy to reproduce

  7. Abec14ad59a61e79de60fa378773e964?d=mm


    Feb 06, 2014 08:49

    "NOT" FIXED. I am still having this issue in version 4.3.1f. It even happens with scriptable objects which is just logical while this seems to be an compiler issue to me.

  8. B815950785506e0ea2f93e5bac57e48c?d=mm


    Feb 03, 2014 15:41

    Just had a look at the bug, it's fixed in the next version of Unity, which is why it's marked as fixed now. We can see this isn't very clear and will try to resolve this.

  9. 6b3eeaf8b66e76d23d741f16ac5dad69?d=mm


    Feb 03, 2014 07:44

    I'd like to add issue described here is not exactly what we see today.

    We see message:
    The class defined in script file named 'Tester' does not match the file name!
    if class Tester is placed into namespace, have method with default parameter and derives from MonoBehavior.

    Just like I described in comments here:

  10. 737e414c0a03194b43d91281fc46a018?d=mm


    Feb 02, 2014 19:50

    It still reproduces.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.