Differentiate a particular element of the bluepint via raycast

I’m trying to interact with certain components in a bluepint made ​​up of several components.
I am using a raycast, which also use it to interact with actors.

My question is:
can I differentiate a particular element of the bluepint via raycast, and thereby interact with it?
For example i want to interact with only 3 buttons of a blueprint made by a lot of other components.

share the example:

FHitResult Hit(ForceInit);
	if (GetWorld()->LineTraceSingle(Hit, StartTrace, EndTrace, ECC_WorldStatic, TraceParams))
	{
		interactiveLastItem = Cast<AInteractive>(Hit.GetActor()); 
		//BP//////////////////////////////////////////
		interactiveLastItem->InteractInBP();
		///////////////////////////////////////////////
	}

and the BP:

note that BPInteract event is called from cpp
(With this example i am getting the blueprint name, not a particular component in it)
Thanks!

Hi

I’ve just faced the same problem and found the following solution (blue print).

Basically, it runs on Tick event, make a raycast, check what component is hitted, then get it’s name and based on that do something (for clarity in the attached BP it just prints the component’s name on screen)

Hope this helps
Cheers

thank you very much, this helps me to solve my problem doing it in cpp

This is what I need in cpp:

.h
UPROPERTY(BlueprintReadOnly, Category = Interacting)
class UPrimitiveComponent* interactiveLastItemComponent;

.cpp
interactiveLastItemComponent = Hit.Component.Get();