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

I want to attach pawn like this :

333003-screenshot-2021-03-19-215643.jpg

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.

Hello! If you are using BP you can use nodes AttachActorToActor, AttachActorToComponent or AttachComponentToComponent

Ok I see, Thanks. But I can’t attach actor to pawn or attach pawn to actor.

Why? I just checked that out on 4.26 and everything is Ok, attachment is displayed in World Outliner