I’m attempting to set up a for loop where a number of actors are spawned and then attached to a socket on the owner’s skeletal mesh. In doing this I’m trying to figure out how I can take int i and some how get it to be appended onto the FName that gets passed into AttachToComponent. If that’s unclear here is the code from my first attempt:
int32 i = 1;
FString TempString =FString::FromInt(i);
WeakPoint = GetWorld()->SpawnActor<AWeakPoint>(WeakPointClass);
WeakPoint->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeakPoint0" + TempString));
“WeakPoint” is an actor pointer of the type I am trying to spawn.
This is the error I am getting:
error C2664: ‘void AActor::AttachToComponent(USceneComponent *,const FAttachmentTransformRules &,FName)’: cannot convert argument 3 from ‘FString’ to ‘FName’