- Home /
Character customisation demo - errors in 2.6
I recently downloaded the 'Character Customisation' demo for Unity. Loading it into Unity 2.6 it had to update the project. The scripts produce several errors that i've fixed, but one I just can't work out what the problem is.
The line is
StringHolder holder = ScriptableObject.CreateInstance<StringHolder> ();
error is CS0308: The non-generic method `CreateInstance' cannot be used with type arguments.
Anyone got any ideas what is wrong?
The code looks right to me, but I guess I must be missing something. Though its slightly worrying for a demo/tutorial to find a script error of 'var' being used in c# for defining a property instead of the proper type. I mean what happened to QA? Makes me wonder if there is something else going on with the above error, but i've tried rebuilding the project to no effect.
Answer by Noise crime · Jan 04, 2011 at 03:21 AM
So with a little nudge from Eric5h5 it would appear there are two different 'character customisation' demos on the Unity website. One for Unity 3.0 and an older one for 2.6. Doesn't help that both pages look exactly the same (apart from one ambigious element - see below), though thankfully the actual filenames of the projects are different.
Version 3.0 45mb - CharacterCustomization
Version 2.6 65mb - Characterdemo
Doing a Google search for the demo, led me to the Unity 3.0 version, though nowhere on the page did it say it was for 3.0! There is some actual text to the side that says 'Unity 2 Resources' which actually led me to believe it was a version 2.0 demo. In actual fact the text is really a button that takes you to the old Unity 2 resource page.
Its been frustrating to lose 1.5 hrs over this, especially since Unity 2.6 incorrectly identified the project as being created in an 'older' version of Unity, where in fact it appears to be version 3.0! Had the warning message correctly stated it was 'too new' I could have saved myself all that time!
Still at least I learned that var is acceptable in C# from Eric ;)
Answer by Eric5h5 · Jan 04, 2011 at 02:58 AM
There's nothing wrong with using "var" in C#. It's not an error, and in any case you need Unity 3 to use this demo. Trying to load Unity 3 projects into Unity 2 generally doesn't work.
ah thx, but now i'm very confused as when I downloaded the demo it didn't mention anything about needing version 3, in fact there was some big text to the left saying 'Unity 2 Resources', though now I discover its a button to take you to another menu! Then it gets a bit weirder as on that page there is a 'character customization' demo, but its a different size (65mb vs 45mb) to the one I downloaded before.
So wondering why two versions? Will test the other one out in a $$anonymous$$ute. But also wondering what features make it require Unity3?
thx for you input, it set me on the right course to work out what was wrong and i've posted the 'correct answer'