I created a C++ class inheriting from UObject, called AttachmentBase. I then created another C++ class inheriting from AttachmentBase, and called this SightAttachment. I have then created a blueprint class inheriting from SightAttachment (after adding Blueprintable and BlueprintType to the UCLASS() specifier as seen below), and called this blueprint class PrototypeScope.
UClass specifier:
UCLASS(Blueprintable, BlueprintType)
class FPSGAME_API USightAttachment : public UAttachmentBase
{
GENERATED_BODY()
(properties)
};
I then created a struct in another actor’s file, exposed to blueprints, and have a field for entering a USightAttachment class (as I plan to have more types of USightAttachment, extended with blueprints)
Thanks for the reply.
My initial approach before relying on UObject was to make SightAttachment a child of UActorComponent, but then in the struct, the field USightAttachment* SightAttachment would not show anything in blueprint (it was like the blueprint picture I sent before, but just had no input at all under attachments, not even a box saying none). It still worked fine when the type was UObject* or AActor* but not USightAttachment*, so I tried UObject instead (and here we are now).