Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug ArgumentException: 'type' parameter is abstract and can't be used in the ObjectFactory

Discussion in 'Editor & General Support' started by MasonWheeler, Feb 6, 2021.

  1. MasonWheeler


    Apr 2, 2016
    I've got a class whose parent is UnityEngine.Object. (Yes, I really do want it to be a UE Object. No, I don't want it to be a ScriptableObject.)

    I'm trying to instantiate a member of this class. I call ObjectFactory.CreateInstance<MyObject>() and I get a bizarre error:

    ArgumentException: 'type' parameter is abstract and can't be used in the ObjectFactory: MyObject

    The error is clear, straightforward, well-worded... and completely wrong, as this is not an abstract class. I checked in the reference source, and that error message isn't found anywhere. There is a check to see if the class is abstract, but it gives a different error message which I'm not seeing, which means that this is coming from the black box C++ code somewhere.

    Does anyone know what can cause ObjectFactory to give a false positive here, and how I can work around it?
    Bodix_ and Bogdan_Nikolayev like this.
  2. Bodix_


    May 6, 2018
    The same... Have the bug in the fundamental feature (object creation).
  3. Malbers


    Aug 7, 2015
    I still get that error... same case here :(
    Same bug
    A year later...