UFUNCTIONS not showing up in Blueprint

flo.rian_zh
Thu, 17 Oct 2024 14:57:28 +0000
C++

I have a simple Actor Component in Blueprint and just want to add a Function that is usable in blueprint, but whatever I do the function does not show up in the blueprint graph, when I add the component to an actor.

MyActorComponent.h

#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "MyActorComponent.generated.h"

UCLASS(Blueprintable, BlueprintType, ClassGroup = ("Test"), meta = (BlueprintSpawnableComponent))
class MRSVSPACEPLUGIN_API UMyActorComponent : public UActorComponent
{
	GENERATED_BODY()

public:
	/** Please add a function description */
	UFUNCTION(BlueprintCallable, Category="Test")
	void MyTestFunction(FString TestInput);
};

MyActorComponent.cpp

#include "MyActorComponent.h"

void UMyActorComponent::MyTestFunction(FString TestInput)
{
	UE_LOG(LogTemp, Display, TEXT("MyTestFunction"));
}

I can add the component to an actor:

But I can’t see the function:

I tried adding different specifiers and metadata and even copied some code from another plugin that does this (and it works if I use the plugin), but I can’t get it to work in my code. What am I doing wrong?

Any help is greatly apprecciated!

6 posts - 4 participants