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

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567>\
**Category:** C++\
**Tags:** attach, world-outliner, unreal-engine, pawn, question, CPP\
**Created:** [March 19, 2021, 2:02pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567 "2021-03-19T14:02:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanwang0521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ryanwang0521](https://forums.unrealengine.com/u/ryanwang0521)\
**Post date:** [March 19, 2021, 2:02pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567/1 "2021-03-19T14:02:13Z")

</div>

I want to attach pawn like this :

![333003-screenshot-2021-03-19-215643.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/a/77a75508af2cc3e46a7366ce85278f304a2bad1d.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [March 19, 2021, 3:46pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567/2 "2021-03-19T15:46:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ryanwang0521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ryanwang0521](https://forums.unrealengine.com/u/ryanwang0521)\
**Post date:** [March 21, 2021, 7:59am UTC](https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567/3 "2021-03-21T07:59:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [March 21, 2021, 9:36am UTC](https://forums.unrealengine.com/t/is-it-possible-to-attach-pawn-to-actor-in-world-outliner-procedurally/480567/4 "2021-03-21T09:36:04Z")

</div>

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