Using .cpp and .h files in UE5

I’m comfortable coding in C++, but creating Blueprints for some things in Unreal Engine 5 has been confusing, so I wanted to write my own C++ scripts and attach them to actors manually.

First, I tried adding a C++ component to a Blueprint, but the new components didn’t show up in the Blueprint editor — even though they were visible in the source files and compiled fine.

After digging around, I saw that adding UCLASS(Blueprintable) to a class in the .h file should make it Blueprint-accessible, which is what I want. So I did that for my custom Paper2D character class (which inherits from APaperCharacter). The class compiles without issues in Visual Studio, but when I try to create a new Blueprint from it, it’s not showing up in the “All Classes” section of the “Create Blueprint” dialog.

I’ve verified that:

The class uses UCLASS(Blueprintable)

GENERATED_BODY() is present

It inherits from APaperCharacter

The files are correctly placed in Source//

The build succeeds with no compile errors in my own module

However, I still can’t find the class when creating a Blueprint from it.

TL;DR:
:white_check_mark: Wrote a valid C++ class inheriting from APaperCharacter
:white_check_mark: Used UCLASS(Blueprintable) and GENERATED_BODY()
:white_check_mark: Built successfully
:cross_mark: Class does not appear under “All Classes” when trying to make a Blueprint from it

I use UCLASS(BlueprintType) and it works, maybe you can try it.

thanks I’ll give it a try in about an hour from now, hope it works, if so, you are a life saver

This has not done the trick, I’m going to review the code and write the other files in hopes that the issue is the main file is trying to pull requests from files I have not actually created yet but knew I was going to need. If all else fails I will drop a code snipit and maybe someone can see something I can’t.

tbh I use Chatgpt in such cases.
Sometimes it starts gibberish like reinstall UE, but sometimes it just fixes it by finding a typo or one missing property.

Blueprintable => Shows up in blueprint
BlueprintType => Shows up as a variable type

You can use the combination

UCLASS(Blueprintable ,BlueprintType)