Control a pawn with character

How can I control a pawn with character? The control inputs should be in character.

I want to control a character and a pawn in 2 different rooms at the same time. The connection should be separable from the character at any time with the B-key. Problem: I can’t make a connection between character and pawn. Pawn doesn’t respond.

Character:

Pawn:

I am a beginner, can you show me?

I meant as an example. There is one character and several pawns.

“Do you click on it, do you enter a trigger?”

Yes, every room has a trigger.

Is this about pushing boxes?

How can I control a pawn with
character?

On its own this makes little sense. You may want to include more info if you need help. An example of what you’re trying to achieve and what’ve you’ve tried. What works and what does not.

In the first pic, you’re sending the interface message to the Character, not to the Pawn. You need the Pawn reference as the target for the BPI.

Can I show you what? How to obtain a reference to a Pawn?

  • I don’t know how you built your game
  • I don’t know how the Pawn got into your game (spawned dynamically, spawned by the Game Mode, dragged into the scene…)
  • I don’t know how many Pawns are there

There’s like 12 different ways to obtain a reference to an actor. But that depends on the circumstances. Is there always 1 pawn / 1 character? How does the Character know which Pawn would move with it?

several pawns.

So how does the character know which pawn to control? Do you click on it, do you enter a trigger, press a button, choose from a menu, something else? Are the Pawns tied to the other rooms? In which case how does the character know which room? Anything?

I’d love to help but I know nothing about what you’re doing and you’re asking a very abstract questions.

I mean you can always Get Actor of Class / Tag but that’s a horrible solution in most cases.

Yes, very room has a trigger.

So what happens when the character enters the trigger? How is the trigger connected to the room the Pawn is in?

Here’s what I understood so far:

  • some rooms with with Pawns (the Ball) and triggers
  • character enters a trigger, we press a Key and start controling the Pawn in that room when the character moves around

How close am I?

Cool, makes sense. I’ll post something in a bit.

when the character enters the trigger
and clicks B-Key, the character should
be connected to the pawn

  • the Pawn:

  • the Room; each has a Child Actor Component with a Pawn

  • our character:

  • we press a button so see what we overlap
  • grab the child actor from the CAC and store its reference

Image from Gyazo

Hope it helps.


You do not need a BPI for this providing Pawns have a floating movement component. But you, of course, can use it since now you have a reference. This would save you one cast, you’d just need an Actor the CAC is holding onto.

when the character enters the trigger and clicks B-Key, the character should be connected to the pawn