Custom Actor Component is none during runtime

Hi,

I am a beginner and trying to use a function created from Actor Component (CPP) class. When I set this up in Blueprint for testing, it is showing me error of empty object.

“Blueprint Runtime Error: “Accessed None trying to read property SelfTarget”. Node: Show Basic Info Graph: EventGraph Function: Execute Ubergraph Main Blueprint: Main”

I have made a config as shown in below screen by creating a variable with Object Reference to the Actor component class.

Header File code
UFUNCTION(BlueprintCallable, Category = “Custom Actor Components”)
FString ShowBasicInfo(FString infoParam);

Cpp code
FString UMyCppActorComponent::ShowBasicInfo(FString infoParam)
{
return FString(infoParam);
}

I am calling this custom component in a level blueprint. I want to understand
how do we create an instance for a custom Actor Component or for Blueprint function library in a main level blueprint.

Please help provide required info or docs where I can learn this implementation.
Thank you.


Khalid