# Connect character with the Pawn

**URL:** <https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297>\
**Category:** UI\
**Tags:** interface, trigger, unreal-engine, question\
**Created:** [September 2, 2021, 11:12am UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297 "2021-09-02T11:12:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 2, 2021, 11:12am UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/1 "2021-09-02T11:12:33Z")

</div>

It doesn’t work. When the character enters the trigger and clicks the E button, the character should be connected to the pawn. If the character is connected to the pawn, then I want to control the pawn. But if the character leaves the Trigger Box or clicks the E button again, the connection with the pawn should be terminated.

Pawn

 ![347855-pawn.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/a/a0ada61535172b25bf04c99b646400cf5ceb2140.png)

 ![347852-pawn-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/c/95cbdc7f09295acb644f17f70609bbe2fb65d088.png)

Character

 ![347853-character.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/5/a8510a98757de28a9ff9123273a678797394a9a1.png)

Actor Component

 ![347854-actor-component.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/e/3eeeb085c5f64cd0459ac85ba92581688d34cbf8.png)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![NerdMac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NerdMac](https://forums.unrealengine.com/u/NerdMac)\
**Post date:** [September 2, 2021, 4:53pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/2 "2021-09-02T16:53:02Z")

</div>

What you are looking for is possessing a Pawn.  
Basically, you tell your controller which character or pawn you want to control.  
You can still use the overlap events to switch between the pawns. That should work pretty smoothly.

Take a look at these two pages to get you started.

[Possess Docu](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Pawn/Possess/)

[How to Possess Pawns](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/HowTo/PossessPawns/)

Hopefully, this will get you on the right track.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 2, 2021, 5:16pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/3 "2021-09-02T17:16:17Z")

</div>

I want to control an indefinite number of Pawns. Character should continue to be active.

---

<div class="post-metadata">

**Author:** ![Jaco001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jaco001](https://forums.unrealengine.com/u/Jaco001)\
**Post date:** [September 2, 2021, 5:55pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/4 "2021-09-02T17:55:39Z")

</div>

I have similar case. Multiplayer game with vehicle that can be rided by few players, one can steer.  
Possessing in this case is the dead end cuz players can change seats, HUD must be still active and more things under hood. I will try similar approach like this

 ![347849-pic4.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/e/21e5578a5e01fb7bd84ba8fd14ab3968f78f3268.png)

Just switch in input that will be redirected to ‘attached’ vehicle. If you have any progess write there.

---

<div class="post-metadata">

**Author:** ![NerdMac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NerdMac](https://forums.unrealengine.com/u/NerdMac)\
**Post date:** [September 3, 2021, 6:21am UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/5 "2021-09-03T06:21:58Z")

</div>

I would still use possess for the driver. But other than that you’re right. Not the best solution.  
What I would do for passengers:  
When the player hits the interact button and enters the car as a passenger I would attach the player to the car. You can use sockets for positioning within the car.  
For the input: I use [Enhanced Input](https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Input/EnhancedInput/) in my project. I would add a new input mapping context. Within this context only basic input is available like looking around, aiming, shooting and interact to exit the car. No movement, jumping or anything else.  
In that case you don’t have to do any checks within your movement functions if he’s in a car or not.  
When he exits the car just switch the mapping context back and you’re good to go.

---

<div class="post-metadata">

**Author:** ![NerdMac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NerdMac](https://forums.unrealengine.com/u/NerdMac)\
**Post date:** [September 3, 2021, 7:42am UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/6 "2021-09-03T07:42:08Z")

</div>

I’m sorry. I probably don’t understand what exactly you’re trying to achieve 🙂

So you want to control an indefinite number of pawns at the same time? Wouldn’t that mean that all pawns get the same input and would keep their relative positions to each other anyway?  
What’s the difference to attaching the pawns/actors to the character and just control the character? Or by “control” do you mean something different than movement? Because I don’t see how the character ever leaves the trigger box if you control them at the same time.

Again, sorry about all the questions. Just trying to understand a little bit better what you’re trying to do exactly.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 3, 2021, 8:04am UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/7 "2021-09-03T08:04:44Z")

</div>

You should be able to very easily adapt this:

[https://answers.unrealengine.com/questions/1045329/control-a-pawn-with-character.html](https://answers.unrealengine.com/questions/1045329/control-a-pawn-with-character.html)

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 3, 2021, 7:29pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/8 "2021-09-03T19:29:37Z")

</div>

It doesn’t work as expected. If the character leaves the Trigger Box or clicks the E button again, the connection with the pawn should be terminated.

Character

 ![347937-character.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/1/eb1a5cbd0fd244b382c129a22536f0d70dc5f3f7.png)

Actor Component

 ![347938-actor-component.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/d/ccdbffd8ba5f5957f63105b4321c7b7f272a89cd.png)

Pawn

 ![347939-pawn.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/a/90a28dbcc4c9414f1fa68c3b5fd3a8b5ba2082fb.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 3, 2021, 8:06pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/9 "2021-09-03T20:06:56Z")

</div>

> It doesn’t work as expected.

You must adapt it to your needs… It’s just a method, not a plug & play solution.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 3, 2021, 8:28pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/10 "2021-09-03T20:28:01Z")

</div>

Thank you for your efforts. Unfortunately does not work. I can control the pawn, but if the character leaves the Trigger Box or clicks the E button again, the connection with the pawn should be terminated.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 5, 2021, 3:00pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/11 "2021-09-05T15:00:13Z")

</div>

why is the connection with the Pawn interrupted after 5 seconds, although the character did not leave the trigger box.

 ![348026-cast-to-thirdpersonalcharacter.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/8/ee8f46099d1d352662d2ef85853fc38bc418566b.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 5, 2021, 3:18pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/12 "2021-09-05T15:18:45Z")

</div>

No clue but you’re doing something _very strange_ with the array remove… you nullify the reference, make it into an array and then remove nothing from it. Those nodes do nothing - what is it supposed to do?

> why is the connection with the Pawn  
> interrupted after 5 seconds

If the issue is time based, it’s not here - not in the screenshot. But calling End Overlap would sever the execution chain for the Add Movement Input - so something calls that.

---

<div class="post-metadata">

**Author:** ![Jaco001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jaco001](https://forums.unrealengine.com/u/Jaco001)\
**Post date:** [September 5, 2021, 3:29pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/13 "2021-09-05T15:29:24Z")

</div>

![348006-pic8.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/2/4f270e880bb45389aef001c3a190eb67fbb7ac18.png)

This (red) is strange. You check before if it is player. But now anything leaving area - reset your variable… and even strange array. Check first if this is ‘player’. If this is lift anything even landscape can generate this.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 5, 2021, 3:32pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/14 "2021-09-05T15:32:07Z")

</div>

Is that what you mean?

 ![348027-cast-to-thirdpersonalcharactertest.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/9/6391c3c5d74b042089d206470c5bce55516b04d7.png)

But it does not work. If the character leaves the trigger box, the connection is not interrupted.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 5, 2021, 3:47pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/15 "2021-09-05T15:47:36Z")

</div>

How to end the connection with the character?

---

<div class="post-metadata">

**Author:** ![Jaco001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jaco001](https://forums.unrealengine.com/u/Jaco001)\
**Post date:** [September 5, 2021, 4:17pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/16 "2021-09-05T16:17:53Z")

</div>

![348007-pic9.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/9/c09fb62f21f4424d87800473a55ea7dc787a4135.png)

I will be add some valid check. And probably before ‘==’ additional castto… but check if this help first.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [September 5, 2021, 4:37pm UTC](https://forums.unrealengine.com/t/connect-character-with-the-pawn/488297/17 "2021-09-05T16:37:38Z")

</div>

It works! Thank you, you saved me.
