Download

Trouble creating custom node for blueprint

Hello everyone,

I am trying to create a custom node for blueprint that creates an instance of a given class in the memory so I can use it for reference later. I have been working with blueprints since my c++ knowledge is pretty bad :stuck_out_tongue: I know Java and Python, but the syntax in C++ is a mystery at this time.

So I made an inventory system, where I originally created an extension of AActor class “InventoryItem” and created an extension of that class for different types of items with a struct and some variables describing the item.

The problem became apparent when I tried to reference these objects in blueprints, because of course they can’t be referenced without first being created. So I discovered that with AActor classes you need to spawn them in the world to be able to reference them… Spawning the objects in the world seems, less than optimal, and I would like a way to simply create an instance of it in the computer’s memory for reference later without spawning an actor.

So it seems I need to extend directly from the UObject class, but this class has no blueprint function to create an instance in memory.

I found this page: https://wiki.unrealengine.com/Blueprint_Node:_Create_Object_from_Blueprint

But I can’t figure out how to get it to work…

Anyone know how to solve this? REALLY need some help :slight_smile:

I get this weird error which is probably obvious to anyone but me:

CreateNewObject.h

Gives error on [UCLASS(Abstract, Not Placeable)] “This declaration has no storage class or type specifier”

And on [class MYPROJECT_API UCreateNewObject : public UEdGraphNode] “Expected a ;”

CreateNewObject.cpp

Gives error on [UCreateNewObject] “Name followed by ‘::’ must be a class or namespace name”

If someone can give me some pointers it is greatly appreciated!

Bumping, I’m having a similar issue. Trying to create a plugin for some custom hardware using the LeapMotionController plugin as a template, but I’m not really clear on the proper way to add code to a plugin, and when I try just duplicating the code in the LeapMotionController files, I get the same error (trying to follow the same pattern as LeapMotionTypes.h).