Because of the way Components work in spawning and owning, they are trickier than most other objects in the game world to hold a reference to.
For Actor Components, you can use FComponentReference
or FSoftComponentReference
, with UseComponentPicker
to have a drop-down instead of a FName field, AllowedClasses
to filter classes, and AllowAnyActor
to include other actors in the world. Note that in Blueprint Editor you can only fill in the FName with the name of the component. The drop-down picker will be empty.
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(UseComponentPicker, AllowedClasses="/Script/MyProject.MyClass", AllowAnyActor))
FComponentReference MyComponentReference