How to expose custom ActorComponent to Blueprints?

I have some logic that controls the movement of an actor (e.g. its speed). My approach is to make this an ActorComponent so I can add the behavior to an existing actor.

Question 1: Is this correct?

. I would like to make use of this component not in C++ code, but in Blueprints. However, I somehow can’t expose this component to my Blueprints. My understanding is that I should be able to add this extension using the “Add Component” button on the BP’s Components tab.

Question 2: correct?

But my ActorComponent doesn’t show up in the component search.

Final question: What do I have to do to expose it? Specifiy certain macros and attributes?

Thanks for your help!

Hi Rastar,

to expose your custom component to your blueprints you have to set the meta data in C++.
For example:

UCLASS(meta = (BlueprintSpawnableComponent))
class UMyComponent : public UActorComponent
{
	GENERATED_UCLASS_BODY()
};

Hope that helps.

Daniel

Yes, that did the trick - thanks!

Apparently as of 4.7 you also need to have “ClassGroup=SomeGroup” or it does not show up in the list…