How to set a bool on an ActorComponent from an Actor

You’ll will also want to null check any pointers before using:

Turret* turret = Cast<ATurret>(GetOwner())
if(turret != nullptr)
{
 turret->SetSwitch();
}