I simply added a UChildActorComponent. Not sure if there is any performance difference in doing so, but it wasn’t very complicated like he warned in previous lectures, instead all I did was cast it in my firing method just like we did in Blueprints.
void AWaypointMan::FireWeapon() {
if (!ChildRef_Gun->GetChildActor()) { return; }
auto GunActor = Cast<AGun>(ChildRef_Gun->GetChildActor());
if (!GunActor) { return; }
GunActor->OnFire();
}
I also didn’t attach my camera to the capsule component, like he did in the lecture, and didn’t run into any problems.
(The muzzle temp on there is just a backup location for firing but it is not utilized.)