I was reading the source for [FONT=Courier New]UChildActorComponent::CreateChildActor() today and got a little confused. I’m re-learning C++ after many years away and came across some syntax that I didn’t understand and was hoping some kind soul would help. The following code confused me:
FActorSpawnParameters Params; Params.[bNoCollisionFail](API\Runtime\Engine\Engine\FActorSpawnParameters\bNoCollisionFail) = true; Params.[bDeferConstruction](API\Runtime\Engine\Engine\FActorSpawnParameters\bDeferConstruction) = true; // We defer construction so that we set ParentComponentActor prior to component registration so they appear selected Params.[bAllowDuringConstructionScript](API\Runtime\Engine\Engine\FActorSpawnParameters\bAllowDuringConstructionScript) = true; Params.[OverrideLevel](API\Runtime\Engine\Engine\FActorSpawnParameters\OverrideLevel) = GetOwner()->GetLevel(); Params.[Name](API\Runtime\Engine\Engine\FActorSpawnParameters\Name) = [ChildActorName](API\Runtime\Engine\Components\UChildActorComponent\ChildActorName); Params.[ObjectFlags](API\Runtime\Engine\Engine\FActorSpawnParameters\ObjectFlags) &= ~RF_Transactional;
FActorSpawnParameters is a struct. I’m confused by the dot followed by square brackets followed by parens. I’m assuming that these lines are populating the struct, but the syntax here is new to me.
Any help would be appreciated.