"No default constructor found" when using System.object and trying to assign a bool or string

Issue #229 resolved
Gabriel Acosta created an issue

When you have a system.object reference you can click on the null object in the in the inspector to choose what you want to assign to it. However, if you type in the search bar System.bool or System.string, you are unable to assign it, to their right it says "No default constructor found" and clicking does nothing.

However, if you assign a boolean or string through code, it shows up in the inspector and you can edit it and everything. I've attached an example script. Assign it to an empty gameobject. When you hit play, you'll see that the booleans get assigned and you're able to edit them in the inspector. But manually clicking the object and selecting bool, string, etc. doesn't work (but it does work for regular classes).

Comments (2)

  1. Tor Esa Vestergaard

    Thanks for the issue report! We managed to reproduce this bug, and have introduced a fix that takes care of it. This fix will be in the next patch release of Odin.

    If you have need of the fix before that, please send me a mail at tor@sirenix.net with your Odin invoice ID, and I'll send you a fixed build.

  2. Log in to comment