UChildActorComponent Call a Function

Thanks a lot it workes :slight_smile:

this is the .h file

UPROPERTY(EditDefaultsOnly, Category = Weapon)
	TSubclassOf<class AParentWapon> WeaponClass;

class AParentWapon* WaponR;

and .cpp file

  FActorSpawnParameters SpawnParams;
    SpawnParams.Owner = this;
    SpawnParams.Instigator = Instigator;
    WaponR = GetWorld()->SpawnActor<AParentWapon>(WeaponClass, GetActorLocation(), GetActorRotation(), SpawnParams);
    		
    WaponR->AttachToComponent(FpCamera, FAttachmentTransformRules::SnapToTargetNotIncludingScale);