Version 4.12.5
The MimicActor below does not spawn above ac. There is no other object that interferes with the spawn at all. So why???
AActor* ac = ...
FTransform Transform(ac->GetActorRotation(), ac->GetActorLocation() + FVector(0.0f, 0.0f, 1000.0f), FVector(1.0f, 1.0f, 1.0f));
FActorSpawnParameters param;
param.Template = ac;
param.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
MimicActor = GetWorld()->SpawnActor<AActor>(ac->GetClass(), Transform, param);
After some experiment I am able to answer the question by myself.
My finding is that, for the overloaded function
template<class T>
T * SpawnActor
(
FVector const & Location,
FRotator const & Rotation,
const FActorSpawnParameters & SpawnParameters
)
when the member of FActorSpawnParameters ``Template’’ points to some template actor, both Location and Rotation are interpreted as relative values. In other words, zero FVector and FRotator yields a replica of the actor that overlaps the original template actor.
Perhaps I should delve into the source code to be more confident about the assumption above.