SpawnActor with Template does not Tick

If i use :

AFloatingMyActor* ClonedActor = this->GetWorld()->SpawnActor(CurrentActor->GetActorLocation(), FRotator::ZeroRotator);
//Not shown, Here i add a SceneComponent as RootComponent of ClonedActor a cube
ClonedActor->SetActorLocation(CurrentActor->GetActorLocation() + FVector(0, -100, 0));

Then ClonedActor has it’s BeginPlay() method called and it’s Tick( float DeltaTime ) called at some interval.
That’s fine and my cloned actor floats just like any AFloatingMyActor created by hand in the “world outliner”.

Now if i want to use a template actor with the FActorSpawnParameters structure in order to recover all the values in the UPROPERTYs of a AFloatingMyActor created by hand in the “world outliner” which reference is called CurrentActor:

FActorSpawnParameters p;
p.Template = CurrentActor; //an instance of AFloatingMyActor
p.bNoCollisionFail = true;
p.Name = TEXT("TEST");
p.Owner = CurrentActor->GetOwner(); //resolves to NULL
AFloatingMyActor* ClonedActor = this->GetWorld()->SpawnActor(CurrentActor->GetActorLocation(), FRotator::ZeroRotator, p);
//Not shown, Here i add a SceneComponent as RootComponent of ClonedActor a cube
ClonedActor->SetActorLocation(CurrentActor->GetActorLocation() + FVector(0, -100, 0));

Then ClonedActor has it’s BeginPlay() method called and it’s Tick( float DeltaTime ) is never called !!!
ClonedActor->CanEverTick(); // resolves to false even though the constructor of AFloatingMyActor contains PrimaryActorTick.bCanEverTick = true;
That’s my main problem actually while i try to learn UE4.

I try to clone actors with C++ because our teacher said we better learn UE4 via C++ and looks like there’s no way in UE4 to make C++ actor Asset.

Bonus oddity that would be cool to sort out :

Strangely i have to position the ClonedActor at CurrentActor->GetActorLocation() because the template actor gets moved to the position of the spawned actor. Then if i want my template actor to not move i have to put my clone at template position. The documentation says that the FVector passed to SpawnActor is the position of the spawned actor, not that the template actor gets moved too !! And it does that anyway.

Thanks for help.

Sorry for double post, i got an internal error and re-clicked the post button as i though post was not published.

Looks like the website stripped the [AFloatingMyActor] following each SpawnActor call !!
I use [] because standard template marker are stripped…

Note that i do that in :
void AQuickStartGameMode::BeginPlay()
{
//previous code goes here
}

Hi !

We’re facing the same problem. Did you find any solution ?

Hi,
No sir.