Creating class without parent

In the editor, when creating a C++ class via “Add code to project”, there are a bunch of “templates”. Is there a way to just create a standard class?

I am asking this because I want to create a class which will serve as an inventory for my character, but I want it to be hooked into the editor via uclass, uproperty, ufunction etc, and I am curious how this would be done.

Thanks in advance, Ryan.

Huh? There no templates. You might be confused with parent selection screen, but you only picking parent for your class :stuck_out_tongue: UE4 has object management system and game code should be part of it by being inherent to UObject, it contains minimum code in order to your class to communicate with rest of the engine systems, if you want your class to be able to interact with editor it needs at least child of a UObject (it will be “Object” in parent selection screens) as editor is made to interact with UObjects. You can use standard class but editor won’t know how to interact with it and things like UCLASS() will only generate code only for UObject related classes.

Also if you want to make something that can be placed in the world you need to be at least child of AActor which has basic code for object in the world and so on

So for inventory make a inventory manager pick UObject as parent, for item base class which child will be different items use AActor so you can palce item in the world, when you pick item you make it invisible and place in to array which is in inventory manager, which is attached to player controlled APawn or APlayerController.

There is currently no way to create regular C++ classes (i.e. non-UObject classes) from within the Editor. You will have to add such classes in Visual Studio. For the next 4.1 upgrade we are making a series of improvements to the Add Class dialog in the Editor, but I’m not sure whether regular C++ classes will be supported yet. If not, I will bring it up for discussion for the 4.2 release.

Ah, so I would extend UObject, thanks man, you really cleared this up for me :slight_smile: