Is it possible to attach pawn to actor in world outliner procedurally?

ryanwang0521
Fri, 19 Mar 2021 14:02:13 +0000
C++

I want to attach pawn like this :

How to attach pawn to an actor procedurally?

Update:

I spawn a Pawn:

APawn* myPawn = GWorld->SpawnActor<APawn>(NewObject<APawn>()->GetClass());

And try to Attach:

myPawn->AttachToActor(OriginActor, rule);
inCamSet->AttachToActor(myPawn, rule);

But it not attach to anything.

4 posts - 1 participant