My C++ class has functions marked as BlueprintCallable
, but they don’t show up in the Blueprint Event Graph editor.
My goal is to add several functions that can be called from Blueprints. For example, I want to create a function FVector GetForce() const;
. However, after days of troubleshooting, I can’t get this function to appear.
Here’s the simplified C++ subclass I created:
UCLASS(ClassGroup = Newton, meta=(BlueprintSpawnableComponent), HideCategories = (Physics, Collision), MinimalAPI)
class UNewtonRigidBody : public USceneComponent
{
GENERATED_BODY()
class NotifyCallback;
public:
// Sets default values for this component's properties
UNewtonRigidBody();
// Blueprint interface
// UFUNCTION(BlueprintCallable, Category="Newton")
// FVector GetForce() const;
UFUNCTION(BlueprintCallable, Category="Transformation")
FVector GetUpVectorNotWorking() const;
};
To investigate, I added another function, FVector GetUpVectorNotWorking() const;
, but it still didn’t work. I followed instructions from this tutorial on exposing C++ to Blueprint carefully, so I don’t believe I’m missing any steps.
Here’s what I’ve checked so far:
- I’ve confirmed that if I create an Actor subclass of
AActor
instead, the new functions do show up in the Blueprint editor. - I’ve tried refreshing and rebuilding the project several times, but it hasn’t helped.
The video below demonstrates the problem in action:
So people suggest thing liek this
- Class Inheritance: Functions in subclasses of
USceneComponent
can sometimes behave differently than those inAActor
classes when exposed to Blueprints. Testing withAActor
was a good step, but if this is mandatory in a component class, try re-parenting or switching toUActorComponent
to see if it makes a difference.
but in my case this is no an option since my class must be movable.
- Meta Flags and Blueprint Category: Use
Blueprintable
in theUCLASS
specifiers if you haven’t already. Some other useful meta tags could includeBlueprintType
orBlueprintInternalUseOnly
, depending on your use case.
this is on the side that I have no idea what it mean.
does any one has any insight as to what I am doing wrong or missing?