You’ll will also want to null check any pointers before using:
Turret* turret = Cast<ATurret>(GetOwner())
if(turret != nullptr)
{
turret->SetSwitch();
}
You’ll will also want to null check any pointers before using:
Turret* turret = Cast<ATurret>(GetOwner())
if(turret != nullptr)
{
turret->SetSwitch();
}