I tried like this but the engine crash when I try to access the member value in UE_LOG line
TriggerComponent.h
public:
UTriggerComponent();
UGrabber* Grabber;
TriggerComponent.cpp
void UTriggerComponent::TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
AActor* Actor = GetAcceptedActor();
if (Actor == nullptr) return;
Grabber = Actor->FindComponentByClass<UGrabber>();
UE_LOG(LogTemp, Warning, TEXT("grab key %s"),(Grabber->GrabKeyOn ? TEXT("grab on") : TEXT("grab off"))); //engine crash here